Skip to content

About

Render OpenAI ChatGPT data export as a single offline HTML, ChatGPT-like UI. Open chatgpt-viewer.html in browser, pick the export folder, done — no Python, no server, no upload.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

chatgpt-viewer

English · 简体中文

Release Download chatgpt-viewer.html License: MIT

Render your OpenAI ChatGPT data export (conversations.json + attachments) as a single offline HTML, with a UI that closely mirrors the official ChatGPT interface — date-grouped sidebar, right-aligned user bubbles, plain-background assistant replies, full Markdown / tables / code blocks / images / audio attachments, with reasoning summaries and tool calls collapsed into pill chips.

loader screen conversation view

Two ways to use it:

  1. 🌐 Run in the browser (recommended, zero dependencies) — Download chatgpt-viewer.html, double-click it, then pick your export folder. All parsing happens inside the browser; nothing is ever uploaded.
  2. 🧰 Bake the data in with Python — Embed your export into a single self-contained HTML file. Good for archival or sharing with someone else.

Getting your ChatGPT data export

  1. Open ChatGPT on the web → click your avatar → Settings → Data Controls → Export Data
  2. Wait a few minutes for the email with a .zip, then unzip it
  3. The unzipped folder contains:
    • conversations.json, or several conversations-NNN.json shards
    • chat.html (OpenAI's own bare-bones viewer)
    • user.json / user_settings.json / shared_conversations.json — metadata
    • UUID-named subdirectories (one per conversation with images/audio)
    • Loose file-XXXXXXXX-*.png/jpg/webp attachments at the root

Option 1: Browser mode (recommended)

Grab chatgpt-viewer.html from Releases (or build it yourself, see Option 2). It's a single ~75 KB file. Double-click to open it, then either click "Select export folder" or just drag the entire unzipped folder into the window. Done.

A Chromium-based browser (Chrome / Edge / Brave / Arc) gives the best experience. Safari and Firefox may have limited support for loading local attachments.

⚠️ Your data never leaves your machine — parsing, indexing, and rendering all happen inside the browser process. There are no network requests.

Option 2: Bake the data in with Python

Good for: producing a truly self-contained HTML to share with someone, long-term archival, or skipping the folder picker every time.

git clone https://github.com/daogu-ai/chatgpt-viewer
cd chatgpt-viewer

# Pass your export directory
python3 build_viewer.py /path/to/chatgpt-export
# Output: /path/to/chatgpt-export/viewer.html (50–150 MB, data baked in)

# Or pick an output path
python3 build_viewer.py /path/to/export -o ~/Desktop/my-chats.html

# Or just regenerate a blank build for distribution
python3 build_viewer.py --blank -o chatgpt-viewer.html

Only requires Python 3.8+ stdlib. No pip install needed.

What it can do

  • ✅ Browse thousands of conversations in a single file; sidebar grouped by Today / Yesterday / Past 7 days / Past 30 days / Month / Year
  • ✅ Live title search
  • ✅ Full Markdown rendering (via marked v15): GFM tables, headings, nested ordered/unordered lists, blockquotes, strikethrough, task lists, code blocks
  • ✅ Inline image rendering — automatic file-ID index across root dir, conversation subdirs, DALL-E dir, and user upload dirs
  • ✅ Audio attachments rendered as native <audio> controls (voice mode / real-time conversations)
  • ✅ Model badge under each assistant reply (gpt-5 / gpt-5-thinking / gpt-4o / …)
  • ✅ Reasoning summaries hidden by default, one click to expand
  • ✅ Tool calls (web search / browsing / code execution / Computer Use screenshots / custom instructions) collapsed by default
  • ✅ Strips ChatGPT's internal private-use markers (U+E200..U+E206 citation/highlight chars)
  • ✅ Current conversation reflected in the URL hash — bookmark or share individual chats

Project structure

chatgpt-viewer/
├── build_viewer.py          # Generator (Python 3.8+, stdlib only)
├── viewer_template.html     # UI template (CSS + JS), edit this to restyle
├── marked.min.js            # Markdown engine (marked v15, MIT)
├── chatgpt-viewer.html      # Blank build (~75 KB), upload to Releases
├── README.md                # English (default)
├── README.zh-CN.md          # 中文
├── LICENSE
└── .gitignore

To tweak UI colors / layout / wording, just edit viewer_template.html, then run python3 build_viewer.py --blank -o chatgpt-viewer.html to regenerate the blank build. You don't need to touch the Python.

Compatibility

  • Verified against OpenAI's export format as of May 2026 — covers GPT-3.5, GPT-4, GPT-4o, GPT-5, GPT-5-thinking era conversations.
  • Handles both single-file conversations.json (older exports) and sharded conversations-NNN.json (newer exports).
  • Recognizes both file-XXXXXXXX (dash, DALL-E / uploads) and file_XXXXX... (underscore, audio) ID naming conventions.

If your export format produces a blank result, please open an issue with a sanitized head of conversations.json.

Privacy

  • Browser mode — parsing and rendering happen entirely in your browser. Zero network requests.
  • Python mode — pure local processing, never touches the network.
  • The project ships no telemetry, embeds no CDN, and requires no network to function.

License

MIT. Bundled marked.min.js is from markedjs/marked, also MIT.

About

Render OpenAI ChatGPT data export as a single offline HTML, ChatGPT-like UI. Open chatgpt-viewer.html in browser, pick the export folder, done — no Python, no server, no upload.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages