A powerful, privacy-focused Python tool for analyzing WhatsApp chat history with beautiful HTML reports. Extract insights from your conversations including statistics, media analysis, emoji usage, word clouds, and interactive WhatsApp Web-style message viewing.
- General Analytics: Total messages, chats, groups, media counts
- Time Range: First and last message dates, analysis period
- Activity Patterns: Most active days, hourly distributions
- Message Distribution: Text, photos, videos, audio, stickers, GIFs breakdown
- Content Details: Longest messages, recent conversations
- First & Last Messages: Per-contact message history
- Response Time Stats: Average, median, fastest, and slowest response times
- Message Length: Average length, median, longest message tracking
- Top Contacts: Most messaged people with sent/received ratios
- Balance Scores: Conversation balance metrics
- Contact Profiles: Detailed per-contact statistics
- WhatsApp Web UI: Interactive chat interface for browsing conversations
- Media Breakdown: Photos, videos, audio, documents, GIFs, stickers
- Top Senders: Who sends the most media (with detailed breakdowns)
- Media Timeline: Track media sharing over time
- Word Cloud: Visual representation of most used words
- Word Frequency: Top words with usage counts
- Emoji Statistics: Most used emojis with frequency charts
- Message Length: Character count distribution
- Modern Design: Beautiful, responsive HTML interface
- Dark Mode: Eye-friendly dark theme
- Interactive Charts: Powered by Plotly for dynamic visualizations
- Sortable Tables: Click to sort any column
- WhatsApp-Style Chat: View full conversations in familiar UI
- Single File: Everything embedded in one HTML file
- β 100% Offline: All processing happens locally on your machine
- β No Internet Required: No data sent to any server
- β No Cloud Storage: Your data never leaves your device
- β Open Source: Full transparency, audit the code yourself
- Python 3.8 or higher
- WhatsApp database files (
msgstore.dband optionallywa.db)
- Clone the repository
git clone https://github.com/yourusername/whatsapp-analyzer.git
cd whatsapp-analyzer- Install dependencies
pip install -r requirements.txt- Try with demo data
# Generate demo databases
python3 create_demo_databases.py
# Create a demo report
python3 main.py demo_msgstore.db -w demo_wa.db -o demo_report.html- Open the report
# Open demo_report.html in your browserpython3 main.py msgstore.db -o report.htmlpython3 main.py msgstore.db -w wa.db -o detailed_report.htmlusage: main.py [-h] [-w WA_DB] [-o OUTPUT] msgstore_db
WhatsApp Chat Analyzer - Generate detailed analysis reports
positional arguments:
msgstore_db Path to msgstore.db file
optional arguments:
-h, --help Show this help message and exit
-w WA_DB, --wa-db WA_DB
Path to wa.db file (optional, for contact names)
-o OUTPUT, --output OUTPUT
Output HTML file name (default: report.html)
- Install a root file manager (e.g., Root Explorer)
- Navigate to:
/data/data/com.whatsapp/databases/ - Copy these files:
msgstore.db(message database)wa.db(contact database)
- Create a local WhatsApp backup (Settings β Chats β Chat backup)
- Use WhatsApp-Key-DB-Extractor
- Extract
msgstore.dbandwa.db
iOS WhatsApp databases are encrypted. You'll need:
- iTunes/Finder backup (unencrypted)
- iBackup Viewer or similar tool
- Extract database files from backup
Note: This tool works with unencrypted databases only.
- Total messages, chats, groups, media
- Date range and analysis period
- Most active days
- Pie chart showing message types
- Text, images, videos, audio, etc.
- Media counts by type
- Top media senders table
- Media distribution charts
- Word cloud visualization
- Most frequently used words
- Message length statistics
- Most used emojis
- Emoji frequency charts
- Usage patterns
- Response time statistics
- Longest messages
- First and last messages per contact
- Interactive contact list
- Full conversation view
- Sent/received message distinction
- Media indicators
- Group statistics
- Participant information
- Group activity
- Python 3.8+: Core language
- Pandas: Data manipulation and analysis
- Plotly: Interactive data visualizations
- WordCloud: Word cloud generation
- SQLite3: Database operations
- Emoji: Emoji extraction and analysis
whatsapp-analyzer/
βββ main.py # Entry point
βββ database_reader.py # Database reading logic
βββ analyzer.py # Analysis algorithms
βββ report_generator.py # HTML report generation
βββ create_demo_databases.py # Demo data generator
βββ requirements.txt # Python dependencies
βββ demo_msgstore.db # Demo message database
βββ demo_wa.db # Demo contact database
βββ README.md # This file
This tool supports modern WhatsApp database schemas including:
- Normalized
jidtable structure chat_row_idbased messages- LID (Local Identifier) mapping
- Modern message types
The generated HTML report includes:
- Statistics Cards: Color-coded metrics
- Interactive Charts: Zoom, pan, hover for details
- Sortable Tables: Click headers to sort
- Chat Interface: Browse messages like WhatsApp Web
- Responsive Design: Works on desktop and mobile
- Dark Theme: Easy on the eyes
This tool is for personal use only. Always respect privacy and obtain consent before analyzing others' messages. The developers are not responsible for any misuse of this tool.
- Encrypted iOS backups are not supported
- Some newer WhatsApp beta features might not be recognized
- Very large databases (>1GB) may take longer to process
This project is licensed under the MIT License - see the LICENSE file for details.
- WhatsApp for the messaging platform
- Open source community for amazing Python libraries
- Contributors and testers
Have questions or suggestions? Open an issue on GitHub!
Made with β€οΈ for privacy-conscious WhatsApp users
β Star this repo if you find it useful!







