Convert ChatGPT history to CSV: one row per message
Reviewed .
A spreadsheet is the quickest way to answer questions a chat window can't: which prompts you wrote in March, how long the answers in one project were, or every message that mentions a client name. The data is already in your account export. It just arrives as nested JSON instead of rows.
This guide gets you from the export ZIP to a CSV where each message is one row, then shows what to check before you rely on it. The same steps work for a Claude export.
Get the export first
In ChatGPT, open Settings, then Data controls, then Export data. The download link arrives by email and expires after 24 hours, so save the ZIP as soon as it comes. Claude's export is under Settings, Privacy, Export data. The export explainer covers what is inside the ZIP and why conversations.json is not a flat list.
Keep the original ZIP untouched. Everything below works on it without extracting anything, but a spare copy costs nothing.
Convert it in your browser
- Open the free chat to CSV converter and drop the ZIP, or the conversations.json inside it.
- Choose whose messages to keep: yours, the AI's, or both. Untick Code blocks if you only want prose; code is then replaced by [code omitted].
- To narrow it down, type part of a chat title. Only chats whose title contains that text are kept.
- Check the row count and the preview, then choose Download CSV.
The file is read in the tab and never uploaded. Files up to 256 MB are accepted; if your ZIP is larger, extract it and choose conversations.json on its own, or one numbered part at a time.
What each column means
| Column | What it holds |
|---|---|
| platform | chatgpt or claude, so one sheet can hold both exports |
| conversation_id, conversation_title | Which chat the message belongs to |
| conversation_created | When the chat started, as an ISO date and time |
| message_index | The message's position in the chat, counted before your role filter, so gaps show where you dropped rows |
| role | user or assistant |
| message_time | When the message was sent, if the export records it |
| words | Word count of the text cell |
| text | The message as Markdown |
Sort by conversation_title, then message_index, and each chat reads top to bottom again. Filter role to user to see only your prompts.
Open it without garbling the text
Double-clicking the CSV opens it in Excel directly. The file is saved as UTF-8 with a byte-order mark, which is what tells Excel to show Chinese, accents and emoji correctly instead of rows of odd symbols. In Google Sheets, use File, Import, Upload.
A message that starts with =, +, - or @ is saved with a leading apostrophe. Without it, a spreadsheet would try to run that message as a formula. The apostrophe is visible in the cell; it is a safety measure, not a corruption.
Long answers make tall rows. Turn off text wrapping on the text column, or set a fixed row height, and the sheet becomes easy to scan.
Check what is not in the file
A CSV is a view of the export, not a full copy. Before you count on it, know the gaps:
- Only the current branch. If you edited a prompt or regenerated an answer, the export keeps every version, but the CSV follows the one you last saw. Alternate answers are left out.
- No reasoning or tool output. Hidden thinking steps, search results and code-run output are skipped.
- Attachments become placeholders. An image shows as [image] and a file as [file: name]. The export usually does not contain the file itself.
- Empty messages are dropped. A message with nothing left to show, such as one that only held tool output, produces no row.
To spot-check, open one important chat in ChatGPT, pick a message from the middle, and search for a distinctive phrase from it in the sheet. If it is there with the right message_index, the conversion followed the right branch.
When a spreadsheet is the wrong format
A CSV suits counting, filtering and searching across many chats. To read or share a single conversation, a document is better. The free export viewer saves one chat as Markdown or HTML from the same ZIP. If what you copied is one table from a reply, not a whole history, use the table to Excel guide instead.