Skip to content
Chat to spreadsheet

How to export a WhatsApp chat to Excel or CSV

WhatsApp has no Export to Excel button, but you do not need one. Export the chat as a text file, bring the lines into a spreadsheet, and split each one into date, time, sender, and message with a single formula. It works in Excel and Google Sheets, for chats exported from Android or iPhone.

How to export a WhatsApp chat to Excel or CSV: a WhatsApp guide from Preserve Chat

Why put a WhatsApp chat in a spreadsheet?

A spreadsheet lets you sort, filter, and count. You can show only one person’s messages, pull out every message from one month, count how many messages each person sent, or keep a log of a conversation with a landlord or a client alongside your own notes.

If you only want to read the conversation or show it to someone, a spreadsheet is the wrong shape: replies lose their back-and-forth, and long messages are squeezed into cells. A chat viewer or a shared conversation page is easier to read.

Step 1: Export the chat as a text file

  1. Open the chat in WhatsApp on your phone.
  2. On Android, tap the three-dot menu, then More, then Export chat. On iPhone, tap the contact or group name, then Export Chat.
  3. Choose Without media. The spreadsheet only needs the text, and the file stays small.
  4. Send the file to your computer, for example by email, cloud storage, or by sending it to yourself.
  5. On iPhone the export arrives as a ZIP. Unzip it and use the _chat.txt file inside.

Step 2: Split the chat into columns in Excel

  1. Open a blank workbook. Choose Data, then From Text/CSV, and pick the .txt file.
  2. In the preview, set Delimiter to --Custom-- and enter a character that does not appear in the chat, such as | , so every line stays whole in column A. Choose Load.
  3. In the first empty column next to the first line, enter: =REGEXEXTRACT(A1, "^\[?([\d/.\-]+),? ([\d:.]+(?:[\s\x{202F}]?[APap]\.?[Mm]\.?)?)\]? (?:- )?([^:]+): (.*)$", 2)
  4. In Microsoft 365, REGEXEXTRACT with 2 as its third argument spills the date, time, sender, and message into four columns. Fill the formula down to the last line, then copy the columns and use Paste Values if you want plain text you can sort.

If your Excel has no REGEXEXTRACT

Older versions of Excel do not have REGEXEXTRACT. Use Data, then Text to Columns, three times instead: split at the first " - " (or "] " for an iPhone export) to separate the timestamp from the rest, then at ", " to separate the date from the time, then at the first ": " to separate the sender from the message. Or use Google Sheets, below, which has the formula in every version.

Step 2, in Google Sheets instead

  1. Create a blank sheet. Choose File, then Import, then Upload, and pick the .txt file.
  2. Set Separator type to Custom and enter | , and turn off Convert text to numbers, dates, and formulas. Choose Import data.
  3. In B1, enter: =IFERROR(REGEXEXTRACT(A1, "^\[?([\d/.\-]+),? ([\d:.]+(?:[\s\x{202F}]?[APap]\.?[Mm]\.?)?)\]? (?:- )?([^:]+): (.*)$"), "")
  4. Google Sheets returns each part of the line in its own column. Drag the formula down to the last row.

Clean up the rows that do not split

  • A message with line breaks takes up several lines in the export. Only the first line has a date, so the following lines come back empty. Join them to the row above if you need the whole message, or filter them out if you only need the counts.
  • Lines with no sender, such as someone joining a group or the encryption notice, also come back empty. Filter them out.
  • Media appears as a placeholder such as <Media omitted> or image omitted, not as the file. Filter on the message column to count photos or voice notes.
  • Dates use your phone’s format. If Excel or Sheets reads 03/04 as the wrong day and month, keep the date column as text, or change the spreadsheet’s locale to match your phone.

Save it as a CSV

Once the columns are split, choose File, then Save As (Excel) or File, then Download (Google Sheets), and pick CSV. Keep the original .txt export too: it is the version WhatsApp produced, and a spreadsheet is easy to edit by accident.

What about browser extensions that export to Excel?

Some browser extensions read your chats from WhatsApp Web and save them as spreadsheets. To do that they need access to every chat you have open in WhatsApp Web, not only the one you export. WhatsApp does not make or check them. If you try one, check who publishes it and what it is allowed to access, and remove it when you are done. The text-file method above keeps everything on your own devices.

WhatsApp chat guides

Read next

See all WhatsApp guides