chat-export: Convert WhatsApp Chats to HTML

This tool converts a WhatsApp chat export into two HTML formats: one with inline media (such as images, videos, and audio files) and a compact version with media links.

Video Tutorial (still refers to the previously used tool name instead of chat-export, doesn't cover new features like the non-interactive CLI mode yet):
YouTube"

Binary Release Downloads

Why is this useful?

The HTML export is:

Maybe you want to:

Furthermore, the tool is open-source and runs offline on your computer, so you can be sure that your data is not being sent to any server.
And by the way, it’s free! If you find it useful, you can donate.

Instructions

  1. Export the Chat: Begin by exporting a chat from the WhatsApp app, preferably with media included. For detailed instructions, refer to WhatsApp FAQ. You can for example save it on Google Drive or Dropbox or send it to yourself with WhatsApp.

  2. Transfer the File: Move the exported ZIP file to your computer. If you have sent it to yourself with WhatsApp, you can download it with WhatsApp Web or with the WhatsApp App on your computer. Delete the WhatsApp message afterwards to save space.

  3. Install and Run the Tool:

Option 1: Download Binary Executables: Easy for non-technical users

If you don't know what Python is and just want to use the tool without having to deal with technical details, you can download the binary executables.

Because the .exe is unsigned, you will see a warning, but after clicking on "More Information" you should have the option to run it anyway. An EV code signing certificate for Windows costs a lot. If I get enough donations, I will buy one, so I can release signed exe files.

Once installed on Mac:

  1. Open the Terminal app (e.g. by typing "terminal" in Spotlight Search).
  2. Type: chat-export

This will start the chat export tool from anywhere in the terminal.

To uninstall chat-export from Mac, open the Terminal and run: sudo rm /usr/local/bin/chat-export

The executables have been built with pyinstaller.

Option 2: Install via pip

If you have Python installed, you can install chat-export as a command-line tool: pip install chat-export

Optional: Install with platform-specific dependencies for native file dialogs

For better user experience with native file picker dialogs, you can install platform-specific dependencies:

On macOS: pip install chat-export[macos]

On Windows: pip install chat-export[windows]

Note: Without these optional dependencies, the tool will fall back to command-line input for file selection or use tkinter (if available) for file dialogs. If you're planning to use the tool in non-interactive mode, you don't need to install these dependencies.

After installation, you can run it from anywhere in your terminal:

chat-export

or chat-export --help

To uninstall: pip uninstall chat-export

Using uv tool instead of pip

If you have uv installed, you can use uv tool install instead of pip install. This is perfect for tools like chat-export because it will install the dependencies in a virtual environment and not in the global environment - while still making the tool available globally in your shell / path.

uv tool install chat-export[windows] or uv tool install chat-export[macos] or just uv tool install chat-export uninstall with: uv tool uninstall chat-export

Option 3: Run Directly (No Installation)

If Python is installed on your Windows, Mac or Linux computer, run the tool directly (no pip installation required, no venv required, no additional dependencies required because it's just vanilla standard lib Python in a single scriptfile, always run the latest up to date version directly from GitHub) with the following command: python -c "import urllib.request; exec(urllib.request.urlopen('https://raw.githubusercontent.com/mtln/chat-export/refs/heads/main/chat_export/chat_export.py').read().decode())"

or

python3 -c "import urllib.request; exec(urllib.request.urlopen('https://raw.githubusercontent.com/mtln/chat-export/refs/heads/main/chat_export/chat_export.py').read().decode())"

Options for special features, such as --embed-media or --output-dir, can be passed as command line arguments:

python -c "import urllib.request; exec(urllib.request.urlopen('https://raw.githubusercontent.com/mtln/chat-export/refs/heads/main/chat_export/chat_export.py').read().decode())" --embed-media --output-dir "C:\temp"

or

python3 -c "import urllib.request; exec(urllib.request.urlopen('https://raw.githubusercontent.com/mtln/chat-export/refs/heads/main/chat_export/chat_export.py').read().decode())" --embed-media --output-dir "C:\temp"

or if you have uv installed, you can use uvx:

uvx chat-export

Usage

The tool supports both interactive and non-interactive modes:

Interactive Mode (Default)

Just run chat-export in your terminal. Use CLI parameters for special features, such as --output-dir or --embed-media.

CLI Parameters:

-o, --output-dir: Base directory where the chat folder will be created (optional, default: current directory) --embed-media: Embed media files as base64 in HTML instead of linking to external files (optional)

Command Line Interface (Non-Interactive Mode)

For automation, scripting, or when you know all parameters in advance, you can use the non-interactive CLI mode. This mode processes the chat without any prompts and is perfect for batch processing or integration into other tools.

Media Embedding Options

The tool offers two approaches for handling media files:

Default Behavior (External Media Files): - Creates a folder structure with HTML files and a separate media/ folder - Media files are extracted and linked to from the HTML - Results in multiple files that need to be kept together - Smaller HTML files, but requires managing multiple files

Embedded Media (--embed-media option): - Creates a single self-contained HTML file with all media embedded as base64 - No external media files are created or needed - Perfect for sharing, archiving, or when you want everything in one file - Larger HTML file size, but completely portable

Basic Usage: chat-export -n -z "path/to/chat.zip" -p "Your Name"

CLI Parameters:

Examples:

Basic conversion: chat-export -n -z "WhatsApp Chat with John.zip" -p "Your Name" With absolute path to ZIP file (Windows): chat-export -n -z "c:\temp\WhatsApp Chat with John.zip" -p "Your Name"

With date filtering: chat-export -n -z "chat.zip" -p "Your Name" --from-date "01.01.2024" --until-date "31.12.2024"

Custom output directory (creates chat folder in /tmp instead of current directory): chat-export -n -z "chat.zip" -p "Your Name" -o "/tmp"

Windows paths (important: no trailing backslash): chat-export -n -z "chat.zip" -p "Your Name" -o "C:\temp"

With embedded media (creates a single self-contained HTML file): chat-export -n -z "chat.zip" -p "Your Name" --embed-media

Important Notes: - The participant name must match exactly as it appears in the chat (case-sensitive) - If the participant name is not found, the tool will display all available participants and exit - When using --embed-media, media files are encoded as base64 and embedded directly in the HTML, creating a single self-contained file that doesn't require external media files

Supported languages

WhatsApp chat exports vary depending on your phone’s system language.

chat-export has been tested with many languages and regional settings.

If it doesn't work for your language, please let me know.

Supported Operating Systems

Limitations

There is information in chats, that is not included in the export.zip created by WhatsApp. As a consequence, this information cannot be rendered by chat-export.

This includes:

Disclaimer

chat-export comes with no warranty. Use it responsibly and respect the privacy of other chat participants. The tool is not affiliated with WhatsApp or Meta.

Latest Release

Name
Release 1.0.3
Published
2025-10-28 07:07
Notes
Support for Spanish-style AM/PM format (e.g., "p. m." with spaces and dots).
Now supports all variations:
Standard English: PM, pm
English with dots: P.M., p.m.
Spanish with spaces: p. m., a. m.
Thanks to @aeu79 for this fix!