Exporting from WhatsApp
Extract structured data from a WhatsApp chat
A WhatsApp export is plain text, but each line follows a pattern. Once you separate the date, time, sender and message, you can sort, filter and count the conversation like a table.
What is in each line
Most exports write one message per line, starting with a timestamp, then the sender’s name, a separator and the message text. A message that wraps onto several lines has continuation lines with no timestamp, and those lines belong to the message above them.
The timestamp format depends on the phone’s language and the WhatsApp version. Some exports use day/month/year with a 24-hour clock, and others use a bracketed format with seconds. Check a few lines by eye before you write any parsing rule.
The three fields you usually want
- Who: the sender name as saved on the exporting phone
- When: the date and time of the message
- What: the message text, including continuation lines
Some lines have no sender at all. Those are system messages such as group events or encryption notices. Decide whether you want to keep them, since they can skew message counts.
Turning lines into rows
- Open the .txt file in a plain text editor and read the first twenty lines to learn the date pattern.
- Write or use a rule that matches a timestamp at the start of a line.
- When a line has no timestamp, append it to the message above.
- Split each message on the first separator to get the sender and the text.
- Save the result as CSV with columns for date, time, sender and message.
Spreadsheet tips
Once the data is in a spreadsheet you can count messages per person, filter by date range or search for keywords. Keep the original text beside the cleaned columns so you can check any odd row against the source.
Where ChatIntoPDF fits
If you want a readable version rather than rows, ChatIntoPDF at chatintopdf.com converts the export to PDF in your browser. Excel and CSV output is available on the top tier, which gives you a structured file without writing parsing rules yourself. The free preview lets you check the layout before you pay. ChatIntoPDF is independent and not affiliated with WhatsApp or Meta.
Privacy and accuracy
Chat data is personal. Keep extracted files private, avoid uploading them to tools you do not trust and remove data you do not need. Check results against the source, because edge cases such as multi-line messages and unusual names can shift a row.
Common problems
- Dates that flip between day and month when the export mixes formats
- Sender names that contain colons, which can break a simple split
- Emoji and media placeholders showing up as extra text
- Blank lines between messages
Frequently asked questions
Does a WhatsApp export include phone numbers?
It shows the name as saved on the exporting phone. A number can appear instead when a contact is not saved.
What is the easiest way to get data into a spreadsheet?
Either write a small script that parses the timestamp pattern, or use a converter that outputs Excel or CSV. ChatIntoPDF offers Excel and CSV on its top tier.
Can I extract the media as well?
Yes, choose Include media when you export and the files come in the .zip. Media is separate from the text lines.
Is the extraction automatic?
Not from a plain .txt file. Parsing depends on the export format, so check the output against your source.