AI Chat Export to Markdown and Word
Operator: Abdulla Al Fahad. How tools are built and checked
When you ask ChatGPT or Claude for a copy of your data, the archive that arrives holds your whole chat history in a single file called conversations.json. It is complete, but it is written for machines: every message sits inside nested objects with ids, timestamps and metadata, and a long conversation can run to thousands of lines before you reach the second reply. Opening it in a text editor is not a realistic way to reread an old discussion or to hand one to a colleague.
This converter reads that file, or the export ZIP that contains it, and lists every conversation by title, date and number of messages. You tick the ones you want and save them as Markdown, either as one long file or as a ZIP with one file per conversation, or as a Word document in which each conversation starts on its own page under a heading. Each message is written under a label such as You or Assistant, and you can rename both labels before downloading.
Key features
- Reads the export ZIP directly or conversations.json on its own
- Keeps only the branch that ends at current_node, so regenerated replies and replaced edits are dropped
- Conversation list with title search, message counts, Select all matching and Select none
- Markdown as one combined file or a ZIP with one .md file per conversation
- Word output with one Heading 1 and a new page per conversation, up to 200 conversations per document
- Editable labels for your messages and for replies; system prompts and tool activity optional
- Pictures, audio and attached files shown as placeholders such as [image] and [file: notes.pdf]
- Preview of the first selected conversation as it will be written, showing up to its first 20,000 characters
Export shapes it reads, Markdown it writes
Two layouts are recognised. In the first, used by ChatGPT's export, each conversation has a title, a create_time in Unix seconds, a mapping of message nodes linked by parent and children ids, and a current_node that marks where the conversation ended. In the second, used by Claude's export, each conversation has a name, a created_at date and a flat chat_messages list in which every item has a sender of human or assistant and the text. These are the shapes those exports had when this page was written. If an app changes its export, the file may be refused with the error that names both shapes, so check the file's structure before assuming it is damaged.
You can pick the ZIP as it was downloaded or the conversations.json taken out of it. In a ZIP, the tool looks for a file named conversations.json in any folder, takes the one nearest the top, and ignores the __MACOSX folder that macOS adds when it compresses a folder. The chosen file can be up to 100 MB, and conversations.json inside a ZIP may unpack to at most 100 MB as well. The JSON is decoded as UTF-8, the encoding the JSON standard requires for files passed between systems; a copy that an editor re-saved as UTF-16 is recognised by its byte-order mark and decoded too.
Each Markdown conversation begins with "# Title", then a line such as "Created: 2024-03-09 18:42 UTC", then the messages. Every message has its label in bold on a line of its own, a blank line, and the message text exactly as it was stored, so code fences, tables and lists written in Markdown by the assistant render as they did in the app. In the combined file, conversations are separated by a horizontal rule (---). In the ZIP, each file is named from the date and the title, for example "2024-03-09 Tiles for a small bathroom.md".
How it works
The first four bytes decide the route. A file starting with PK is opened as a ZIP with JSZip, and the size recorded for conversations.json is checked before it is unpacked. Anything else is handed to the JSON parser, unless its first 8 KB contain a byte of value zero: JSON text never does, so such a file is a picture or other binary file with a .json name, and it is turned away with its own message. The text is parsed with the browser's JSON parser, and the first list entry that has either a mapping object or a chat_messages list decides the layout. Entries that fit neither are counted and reported as skipped rather than stopping the whole file.
For the mapping layout, the conversation is rebuilt by starting at current_node and following each node's parent link up to the root, then reversing the path. Every time you pressed regenerate or edited an earlier message, the app stored a sibling branch; walking up from current_node visits only the branch you were looking at when the conversation was last open. If current_node is missing or points nowhere, the walk starts at the root and follows the newest child at each step instead. A guard stops the walk if the links ever loop back on themselves.
Inside each message, string parts of message.content.parts are joined with a blank line between them. A part that is an object becomes a placeholder named after its type: [image], [audio], [video] or [file]. Voice conversations store what was said as a transcription part, and that text is kept. Files listed in the message's attachments that are not pictures appear before the text as [file: name]. Messages marked as hidden from the conversation, system messages, tool output and the assistant's calls to tools such as the code runner are left out unless you tick Include system messages and tool activity.
For the flat layout, messages are written in the order the file lists them. When a message has a content list, its text blocks are used rather than the text field, because the text field can contain stand-in sentences where a tool block appeared. Tool use, tool results and thinking blocks are kept back as tool activity, and attachments or files on the message are listed once each as [file: name] or [image: name].
Downloads are assembled in the tab. The combined Markdown is a single text file, the per-conversation files are zipped by JSZip, and the Word file is built with the docx library. A selection larger than 200 conversations becomes several Word documents, each holding up to 200, stored together in one ZIP.
Common use cases
- Keeping a readable archive of your chats before deleting them from the app
- Moving a research conversation into a notes app that stores pages as Markdown files
- Handing a manager or client a Word copy of the conversation where a decision was worked out
- Searching old answers with your editor or desktop search once every conversation is its own .md file
- Printing one long troubleshooting session with each conversation starting on a fresh page
How to use this tool
- Request your data from the chat app's settings and download the ZIP when the email arrives, or press Try a sample export to see two short conversations.
- Choose the ZIP or conversations.json. The line under the drop area tells you how many conversations were read and which layout was found.
- Type part of a title in Search titles to narrow the list, then use the checkboxes, Select all matching or Select none to set what will be saved. Everything is selected after loading.
- Rename the labels if you want something other than You and Assistant, and choose whether the Markdown download is one file or a ZIP.
- Read the preview to check the labels and formatting, then press Download Markdown or Download Word (.docx).
Example
conversations.json (one conversation, the reply was regenerated once)
[{
"title": "Tiles for a small bathroom",
"create_time": 1710009720,
"current_node": "n3",
"mapping": {
"n0": { "message": null, "parent": null, "children": ["n1"] },
"n1": { "message": { "author": { "role": "user" }, "content": { "content_type": "text", "parts": ["How many 30 cm square tiles for a 2.4 m by 1.8 m floor?"] } }, "parent": "n0", "children": ["n2", "n3"] },
"n2": { "message": { "author": { "role": "assistant" }, "content": { "content_type": "text", "parts": ["About 50 tiles."] } }, "parent": "n1", "children": [] },
"n3": { "message": { "author": { "role": "assistant" }, "content": { "content_type": "text", "parts": ["The floor is 4.32 m² and each tile covers 0.09 m², so 48 tiles. Add 10% for cuts: buy 53."] } }, "parent": "n1", "children": [] }
}
}]2024-03-09 Tiles for a small bathroom.md (label for your messages set to Me)
# Tiles for a small bathroom
Created: 2024-03-09 18:42 UTC
**Me:**
How many 30 cm square tiles for a 2.4 m by 1.8 m floor?
**Assistant:**
The floor is 4.32 m² and each tile covers 0.09 m², so 48 tiles. Add 10% for cuts: buy 53.Tips for best results
- If the export ZIP is over 100 MB because of pictures, extract it and choose conversations.json alone; the pictures are not copied into the output anyway.
- Search for a word that appears in the titles of a whole project, press Select none, then Select all matching to save just that project.
- Choose the ZIP option when you plan to import the files into a notes app, so each conversation becomes its own page with a date-first name that sorts by time.
- Set the reply label to the model's name if you exported chats from more than one app and want to tell them apart later.
- Keep the original export: it holds the alternative branches and file contents that the converted copy leaves out.
Edge cases to watch
Only one branch survives. If you regenerated a reply three times, the version the conversation was showing when the export was made is the one written; the other two are not in the output. If you need one of the others, open the conversation in the app and copy it from there.
Pictures and attachments are not embedded. An uploaded photo becomes [image], a generated image only appears as a placeholder when tool activity is included, and a PDF you attached becomes [file: name] with none of its contents.
In the Word file, Markdown is not converted into Word formatting. Code blocks are set in Courier New on a grey background and the fence lines are dropped, but **bold** markers, # headings and table pipes in a reply stay visible as typed.
Dates are shown in UTC, so a conversation started late in the evening in the Americas can carry the next day's date in its heading and file name.
A reply that was stopped while it was writing a code block leaves the fence open. The tool adds a closing fence after such a message so the next label is not swallowed into the code, which means the output has one line the original did not.
Common errors and how to fix them
- "This JSON is not a chat export this tool can read. It expects one of two shapes..."
- The file parsed as JSON, but no entry had a mapping object or a chat_messages list. This happens with user.json, shared_conversations.json or other files from the same export, and with exports from apps whose layout differs. Choose conversations.json, or the ZIP itself so the tool can find it.
- "This is an HTML page, not conversations.json."
- Some exports include a chat.html file for viewing in a browser. Choose conversations.json from the same folder, or pick the whole ZIP.
- "... has no conversations.json inside, so it is not a chat data export this tool can read."
- The ZIP opened but no file of that name was found in any folder. Make sure you picked the data export archive and not a different download, such as a ZIP of attachments.
- The file or the unpacked conversations.json is reported as over 100 MB.
- For a large ZIP, extract it on your computer and choose conversations.json alone. If conversations.json itself is over 100 MB, delete or archive old chats in the app and request a new export, or cut the JSON list into parts with a JSON tool before converting each part.
- "This file is not valid JSON, so no conversations could be read."
- The file ends early or contains stray characters, usually from a download or extraction that did not finish. Download the export again and choose the fresh copy.
Best practices
- Check the conversation count on screen against what you expect before downloading, especially after a search.
- Leave tool activity off for reading copies and turn it on when you need to see the code a tool ran or the results it returned.
- Use the combined Markdown file for reading start to finish and the per-conversation ZIP for filing.
- Store the converted files somewhere private: they contain everything you typed into the chats.
Why a conversation can have several versions
In the mapping layout, a conversation is stored as a tree rather than a list. When you edit a question you already sent, or ask for a reply to be regenerated, the app keeps the old message and adds the new one as a sibling, so the node above has two or more children. The app only ever shows one path through that tree, and current_node records where that path ends.
Following parent links upward from current_node reproduces that visible path. The alternative is to print every node, which would interleave abandoned drafts with the final answers and make long conversations unreadable. The flat layout has no branches to resolve, so its messages are written in the order the file stores them.
What tool activity contains
Ticking Include system messages and tool activity adds the parts of a conversation the app normally hides or collapses. Depending on the layout, these are:
- System messages, labelled System
- Code the assistant sent to a tool, written as a fenced code block under the reply label
- Tool output, labelled Tool with the tool's name when the export gives one, such as Tool (python)
- Thinking blocks, introduced by [thinking]
- Tool use and tool result blocks in the flat layout, introduced by [tool use: name] and [tool result]
How the Word file is laid out
Each conversation title is a Heading 1, so Word's navigation pane lists every conversation and a table of contents can be inserted from the headings. Every conversation after the first starts on a new page. The date line is in grey italics, each label is in bold and kept on the same page as the first line of its message, and a blank line in the message text starts a new paragraph.
Characters that Word cannot store, such as stray control characters copied from a terminal, are removed while the document is built. Without that step Word would refuse to open the file. Letters, emoji and symbols are kept.
Frequently asked questions
Can it read the chat.html file from the export?
No. The HTML file is meant for viewing in a browser. The converter needs conversations.json, which holds the same conversations as structured data.
Why is a reply I remember missing?
It was probably on a branch that was replaced by a regenerated reply or an edited question. Only the branch that ends at the conversation's current node is written.
Are dates converted to my time zone?
No. Every date is written in UTC, and timestamps in the file that carry no time zone are read as UTC too.
Is the export uploaded anywhere?
No. Your export is opened through the page's file picker, then unpacked and converted by scripts in the open tab, and no request carries any of it. The parsed conversations are held in the tab's memory while you choose and download; loading another export or the sample replaces them, and closing the tab discards them. Each download link is a temporary object URL released a few seconds after the download starts.