Reading a ChatGPT export without losing your mind

Back to list2026-07-20
You

I exported my data and got a 700 MB zip. conversations.json is one single line. What do people normally do with this?

ChatGPT

The file is a JSON array of conversations. Each conversation has a mapping of nodes, and each node points at its parent, so the visible thread is the chain from current_node back to the root.

Three things surprise everyone the first time:

  • edits and regenerations create branches, so the file holds more messages than the app shows
  • attachments live outside the JSON, under names that no longer carry an extension
  • exports above a certain size arrive split across conversations-000.json and friends
You
architecture.png
ChatGPT

That is the shape worth aiming for: read the archive once, write plain HTML, and never depend on a server again. Anything that needs a running process will outlive its own usefulness the day you stop maintaining it.

You

How do I walk the tree without blowing the recursion limit?

ChatGPT

Iteratively, with a visited set. Some threads run deeper than Python's default limit of 1000 frames:

def thread(mapping, current):
    chain, seen = [], set()
    while current and current not in seen:
        seen.add(current)
        node = mapping.get(current) or {}
        if node.get("message"):
            chain.append(node["message"])
        current = node.get("parent")
    return list(reversed(chain))

The seen set is not paranoia: a handful of exports in the wild contain a node whose parent chain loops back on itself.

You

And the attachments with no extension?

ChatGPT

Read the first bytes and match the signature. PNG starts with \x89PNG\r\n\x1a\n, JPEG with \xff\xd8\xff, WebP is RIFF followed by WEBP at offset 8. The export also ships conversation_asset_file_names.json, which maps the opaque id back to the name you originally uploaded, so between the two you can restore both name and type.