DatafetchPro
    export-whatsapp-chats
    May 13, 20265 min read62 views

    Export WhatsApp Chats to PDF, CSV, or Markdown

    A free Tampermonkey userscript to export WhatsApp chats from WhatsApp Web into PDF, CSV, or Markdown. How it works, what it captures, and its limits.

    Most people don't think about their WhatsApp messages until they suddenly need them on paper. A client disputes what was agreed. You're switching phones and don't want to lose four years of conversation with someone who matters. You're a researcher who needs real conversation data, or a freelancer who needs a record of what a client actually asked for.

    Then you try to export WhatsApp chats out of the app, and you hit a wall. WhatsApp's built-in export hands you a plain text file that's awkward to search and painful to work with in a spreadsheet. WhatsApp Web shows you the whole conversation in your browser but gives you no way to pull it out. And scrolling through two thousand messages copying text by hand isn't a plan.

    So I built a userscript that does it in one click. This is what it does, how to install it, and — the part most tool write-ups skip — what it won't do.


    What WhatsApp Chat Exporter Pro is

    It's a Tampermonkey userscript — a small piece of JavaScript that a browser extension injects into a site you're already visiting. It doesn't replace WhatsApp Web or log in on your behalf. It runs inside the tab you already have open, adds a green floating button to the interface, and waits.

    Click the button and a panel opens. Pick a format, and the script reads the conversation currently on screen and hands you a file.

    Everything happens locally in your browser. Nothing is uploaded, and there's no server of mine involved at any point — the file is generated on your machine and saved to your downloads folder. That's a claim you can verify yourself: the userscript source is readable in Tampermonkey's editor, and it's short enough to skim in a few minutes.


    Why WhatsApp's own export falls short

    WhatsApp does offer an export function, and for casual use it's fine.WhatsApp's own instructions for exporting chat history walk through it. What you get back is a .txt file with each message on a line prefixed by a date stamp.

    That's fine to read. It's not fine to work with. Getting it into a spreadsheet means writing a parser or doing a lot of find-and-replace, and the format shifts depending on your phone's locale settings. If your end goal is analysis rather than nostalgia, the text file is the beginning of the work, not the end of it.


    How it reads the conversation

    The script works by reading the page's DOM — the structure your browser builds from a site's HTML. Rather than grabbing whatever text is visible and hoping for the best, it targets the specific elements WhatsApp Web uses for message bubbles, sender names, and timestamps, and pulls each field separately. That's why the sender and time end up in their own spreadsheet columns instead of glued to the front of the message text.

    The trade-off: WhatsApp changes its front-end code whenever it likes, and when the element structure shifts, a DOM-based script can break. That's true of every tool of this kind, mine included. If an export suddenly comes back empty, that's usually why.


    Three ways to export WhatsApp chats, and when to use each

    Different jobs want different files, so the panel offers three.

    PDF, for a record you'll show someone

    The PDF export includes a cover page, formatted messages, sender names, and timestamps, styled consistently throughout. Reach for it when a human is going to read the output: documenting a business conversation, sending a record to a client, or filing something alongside the rest of a project's paperwork. You can print it or attach it to an email without any further work.

    CSV, for anything you need to compute with

    This is the format that saves the most time. Each row is one message, with sender, content, date, time, and message type in separate columns. From there it opens directly in Excel or Google Sheets, imports into a database, or loads into pandas in about two lines.

    Converting a WhatsApp chat to CSV is what makes the data actually usable — for anyone doing analysis, building a dataset, or feeding conversation data into something downstream, this is the whole reason to bother.


    Markdown, for Notion, Obsidian, and note tools

    If you live in a knowledge base, Markdown drops straight in with headings and formatting intact. No reformatting step, no cleanup pass. Useful for researchers building a reference library and for anyone documenting a conversation as part of a larger set of notes.


    What the export captures

    Beyond typed text, the script records voice notes, images, videos, stickers, call logs, and dates and timestamps. In group chats it captures sender identification, which matters more than people expect — in a twelve-person group, knowing who said what is often the point.

    Run one export on a chat you know well before you rely on it for anything important. Thirty seconds of checking tells you exactly what you're getting for your particular conversation, which is worth more than any description I can write.


    Installing the Tampermonkey userscript


    1. Install Tampermonkey from Tampermonkey's official extension downloads. It's free and available for Chrome, Firefox, and Edge.
    2. Open the WhatsApp Chat Exporter Pro userscript source. Tampermonkey will offer to install it.
    3. Open WhatsApp Web and open any conversation.
    4. Click the green button in the corner, choose a format, and save the file.

    Before you export a long chat

    WhatsApp Web doesn't hold an entire conversation in the page at once. It loads older messages as you scroll upward. Before exporting a long chat, scroll back to the point you want the export to start from and let the older messages load. If you skip that step on a three-year conversation, you'll get the recent portion and wonder where the rest went.


    What it doesn't do

    • It reads what's in the page. It can't reach messages that were deleted, or chats you haven't opened.
    • It depends on WhatsApp Web's current structure, so a front-end update on WhatsApp's side can break it until the selectors are updated.
    • It's built for WhatsApp Web specifically. It won't work on Telegram, Signal, or Slack.
    • It doesn't run on a schedule or in the background. You click it, it exports.

    The terms of service question

    Automating any part of a site you don't own is governed by that site's rules, and WhatsApp's Terms of Service are the document that applies here. I can tell you exactly what the script does technically — it reads the page already rendered in your own browser, under your own logged-in session, and writes a file locally. Whether running it fits your situation is your call, and worth reading those terms for if you're using it for anything with a compliance dimension.


    Who this is for

    Freelancers and contractors who agree scope, rates, and deadlines over WhatsApp and want that documented somewhere other than a phone.

    Researchers and academics studying communication or language, where clean structured conversation data is genuinely hard to come by.

    Business teams archiving conversations for record-keeping or onboarding without transcribing anything by hand.

    Developers and data professionals building training sets, NLP projects, or chatbots, who want CSV that goes straight into a pipeline.

    Anyone switching phones who wants a backup they can still search in five years.


    When you need the same thing for a site that isn't WhatsApp

    This script exists because I needed it, and it's free. Most of my work is the version of this problem that doesn't have a free script waiting: a supplier portal with no export button, a directory that paginates forever, a dashboard that shows you the numbers but won't let you download them.

    That's what I do — I build the scraper or the browser bot to order, in Python and Playwright, as a no-code macro, or as a userscript like this one, and hand back CSV, a database, or a Google Sheet on a schedule. You can see the full range of automation work I take on, browse other write-ups on browser automation, or read how I work and what I charge before deciding.

    If you already know what data you need and which site it's stuck on, send me the details and I'll scope the build. Tell me the site, the fields you want, and how often you need it — that's usually enough for me to tell you whether it's a two-hour job or a two-day one.

    0

    Rather not build it yourself?

    I build this kind of thing for a living.

    Send me the site and what you need out of it — you'll get an approach, a timeline, and a fixed quote back. Scoping is free.