Skip to content

Export Formats

Svwergio_mel edited this page Nov 12, 2026 · 2 revisions

Export formats — what the text looks like

Chat Export writes the current chat (not a full account dump). Formats: Markdown, YAML, JSON, HTML, PDF. Multi-select can pack into a folder or zip. Filenames: {platform}-{title}-{date}.{ext}.

Schemas (name/version) control how that text is shaped. Default: chat-export/1. Alternative: sharegpt/1. Pick default + per-format overrides in the extension popup (Advanced → Export schemas); the on-page bar still only toggles formats. MCP: optional schema on chats_export (server settings.exportSchema).

This page is the semantic contract for the default schema — how roles, metadata, sources, and bodies are laid out so you can parse or feed vaults / distill pipelines.

Shared message model

Each turn is roughly:

Field Meaning
role Logical role: user, assistant, or a provider-specific slug
role_tag / role marker Display/tag used in MD fences and JSON (role_tag) — e.g. user, assistant, chatgpt, grok, claude, …
text Message body as Markdown-ish plain text (from DOM → htmlToMarkdown)
links Optional [{ text, href }]
sources Optional citations [{ title, url }] (search / grounding cards)

Meta (when available): platform, url, title, exported / exported_at, chat_id, model, user_name, user_handle, user_email.


Markdown (.md) — parse-friendly fences

Designed so a dumb splitter can cut on fenced ```md blocks.

  1. One system fence — language tag md, first line label sys, then key: value lines.
  2. Each message — empty fence whose inner label is the role with a trailing colon (user:, assistant:, chatgpt:, …), then a blank line, then the body.
  3. Optional sources fence — label sources, numbered Markdown links.

Example:

```md
sys
platform: chatgpt
url: https://chatgpt.com/c/…
title: Bake-off notes
exported: 2026-11-12T05:00:00.000Z
chat_id: …
model: gpt-5
```

```md
user:
```

What is the capital of France?

```md
assistant:
```

Paris.

```md
sources
1. [Wikipedia](https://en.wikipedia.org/wiki/Paris)
```

How to parse MD

  1. Find fenced blocks with info string md.
  2. First line inside the fence = label (sys, user:, sources, …).
  3. Remaining lines = payload (sys / sources) or empty for role markers.
  4. Non-fence text between a role marker and the next fence = message body.

Code fences inside the body use normal ```lang (from the chat HTML), not the md role markers.


JSON (.json) — schema: chat-export/1

Stable machine format. Pretty-printed, trailing newline.

{
  "schema": "chat-export/1",
  "platform": "chatgpt",
  "url": "https://chatgpt.com/c/…",
  "title": "Bake-off notes",
  "exported_at": "2026-11-12T05:00:00.000Z",
  "chat_id": "…",
  "model": "gpt-5",
  "messages": [
    {
      "role": "user",
      "role_tag": "user",
      "text": "What is the capital of France?"
    },
    {
      "role": "assistant",
      "role_tag": "assistant",
      "text": "Paris.",
      "sources": [
        { "title": "Wikipedia", "url": "https://en.wikipedia.org/wiki/Paris" }
      ]
    }
  ]
}
  • Always start parsers with schema === "chat-export/1".
  • Prefer role_tag for display; role for coarse filtering.
  • Missing optional fields are omitted (not null).

YAML (.yaml)

Same meta keys as JSON (without schema). Then a messages: list:

platform: chatgpt
url: https://chatgpt.com/c/…
title: Bake-off notes
exported_at: 2026-11-12T05:00:00.000Z
messages:
  - role: user
    text: |
      What is the capital of France?
  - role: assistant
    text: |
      Paris.
    sources:
      - title: Wikipedia
        url: https://en.wikipedia.org/wiki/Paris

Multiline bodies use YAML block scalars (text: |).


HTML (.html)

Standalone document: <article> with <header> + <dl> of meta, then <section data-role="…"> per message (<h2> role heading, body HTML from Markdown, optional Sources <ol>). Print-friendly CSS included.


PDF (.pdf)

Selectable text (including Cyrillic), laid out from the same message stream — not a screenshot. Good for sharing; worse for automated parsing than JSON/MD.


Schema minis

Id Page
chat-export/1 (default) Export-Schema-chat-export-1
sharegpt/1 Export-Schema-sharegpt-1

What this is not

  • Not OpenAI’s bulk “download all chats” ZIP / Conversations.json shape.
  • Not Alpaca JSONL (open an issue if you need another schema pack).
  • Not a guarantee that every provider fills every meta field (DOM/API variance).

Feedback

If you want a different layout, open an issue or add a schema pack (see extension schemas/README.md / CONTRIBUTING). Default remains chat-export/1.

Clone this wiki locally