Parse and export your WhatsApp conversation history to HTML and JSON. Works with Android databases (encrypted and unencrypted) and iPhone backups. Forked from KnugiHK/Whatsapp-Chat-Exporter with an added pipeline layer for processing exports.
Takes a WhatsApp SQLite database — either directly extracted or from an encrypted backup — and renders each conversation as a self-contained HTML file resembling the WhatsApp UI, with media thumbnails and timestamps. Produces an optional single JSON output for downstream processing. Supports decrypting Android crypt12, crypt14, and crypt15 backup formats. iPhones are handled via an iTunes backup path.
| Format | Notes |
|---|---|
Android unencrypted (msgstore.db) |
Direct extraction via ADB or backup tool |
| Android crypt12 / crypt14 | Requires key file extracted from /data/data/com.whatsapp/files/key |
| Android crypt15 (E2E backup) | Accepts the 32-byte hex key or an encrypted_backup.key file |
| iPhone / iPad backup | Point at the iTunes backup directory |
- HTML output per conversation, styled to match WhatsApp's layout
- JSON output (
--json) for programmatic access to message data - Custom HTML template support (
--template) - Contact names from
wa.db/ContactsV2.sqlite - Media copying or moving into the output directory (
--move-media) - Key display for audit purposes (
--showkey) - PIPELINE directory with architecture notes and a scaffolded processing layer (
PIPELINE/main.py)
pip install whatsapp-chat-exporter
# For encrypted Android backup support:
pip install "whatsapp-chat-exporter[android_backup]"
# For crypt15 support:
pip install "whatsapp-chat-exporter[crypt15]"# Android unencrypted
wtsexporter -a
# Android crypt14 backup
wtsexporter -a -k key -b msgstore.db.crypt14
# Android crypt15 — hex key
wtsexporter -a -k <64-char-hex-key> -b msgstore.db.crypt15
# Android crypt15 — key file
wtsexporter -a -k encrypted_backup.key -b msgstore.db.crypt15
# iPhone/iPad
wtsexporter -i -b "C:\Users\<Username>\AppData\Roaming\Apple Computer\MobileSync\Backup\<device-id>"
# All options
wtsexporter --help- Python 3.7+
- SQLite3, Jinja2, bleach / MarkupSafe
- PyCryptodome (AES decryption for crypt12/14/15)
- javaobj-py3 (crypt15 key extraction)
Active as of August 2023. Core export functionality is stable; the PIPELINE layer is scaffolded but not wired end-to-end. Not affiliated with WhatsApp LLC.