Skip to content

shtse8/chatgpt-export

Repository files navigation

πŸ’¬ ChatGPT Export

Export all your ChatGPT conversations β€” JSON, Markdown, Text, or HTML

CI Chrome Web Store License: MIT TypeScript GitHub stars

No API keys. No external servers. No dependencies. Works with Team/Business plans that have no built-in export. Your data stays in your browser.


✨ Features

  • πŸ“€ Multiple export formats β€” JSON, Markdown, Plain Text, or styled HTML
  • πŸ”‘ Auto-authentication β€” uses your existing session, no API key needed
  • πŸ“„ Full pagination β€” exports all conversations, even thousands
  • πŸ”„ Smart retry β€” exponential backoff with jitter on rate limits
  • πŸ”ƒ Token refresh β€” handles expired tokens mid-export seamlessly
  • ⚑ Concurrent downloads β€” configurable parallel downloads (default 3)
  • πŸ“Š Live progress β€” speed, ETA, count, current conversation in real-time
  • πŸ” Search & filter β€” export only conversations matching a keyword
  • πŸ“… Incremental export β€” export only new conversations since last export
  • 🎯 Selective export β€” choose specific conversations to export
  • πŸŒ— Dark & light mode β€” auto-adapts to your system preference
  • πŸ›‘οΈ Error resilient β€” continues on failures, reports errors at the end
  • πŸ’Ύ Auto-download β€” file saves automatically when done
  • 🧩 5 install methods β€” extension, userscript, bookmarklet, console, inject

πŸ“¦ Export Formats

Format Extension Best For
JSON .json Data analysis, programmatic processing, full fidelity
Markdown .md Reading, documentation, version control
Plain Text .txt Simple archival, universal compatibility
HTML .html Beautiful viewing in browser, sharing, printing

The HTML export is self-contained with inline CSS and supports both dark and light mode.

πŸ“¦ Installation

🧩 Chrome Extension (Recommended)

Install from the Chrome Web Store.

Or install manually from source:

  1. Download the latest release ZIP
  2. Go to chrome://extensions/
  3. Enable Developer mode (top right)
  4. Click Load unpacked β†’ select the extracted folder
  5. Navigate to chatgpt.com β†’ click the extension icon

πŸ’ Userscript (Tampermonkey / Violentmonkey)

  1. Install Tampermonkey or Violentmonkey
  2. Click to install: chatgpt-export.user.js
  3. Navigate to chatgpt.com β€” a floating widget appears in the bottom-right
  4. Select your format and click Export All

πŸ”– Bookmarklet

  1. Go to the latest release page
  2. Download bookmarklet.txt and copy its contents
  3. Create a new bookmark in your browser, paste the contents as the URL
  4. Click the bookmark while on chatgpt.com

πŸ“‹ Console Paste

  1. Go to chatgpt.com and sign in
  2. Open DevTools: F12 β†’ Console tab
  3. Copy the contents of inject.js
  4. Paste and press Enter
  5. Choose your export format when prompted
  6. Wait for the file to auto-download

πŸš€ Usage

Chrome Extension

  1. Navigate to chatgpt.com and sign in
  2. Click the extension icon in the toolbar
  3. Choose your export format (JSON, Markdown, Text, HTML)
  4. Choose your export scope:
    • All conversations β€” export everything
    • New since last export β€” only conversations updated since your last export
    • Search by title β€” filter by keyword
  5. Click β–Ά Export
  6. Watch the live progress dashboard
  7. File downloads automatically when complete

Userscript

  1. The floating widget appears on chatgpt.com
  2. Select your format from the dropdown
  3. Click β–Ά Export All
  4. Monitor progress in the widget

βš™οΈ Configuration

When using the engine programmatically (console/inject), you can customize:

const engine = new ExportEngine({
  format: 'markdown',     // 'json' | 'markdown' | 'text' | 'html'
  concurrency: 5,         // parallel downloads (default: 3)
  batchSize: 100,         // conversations per page when listing
  retryAttempts: 3,       // max retries per request
  retryDelay: 2000,       // base retry delay in ms (exponential)
  searchQuery: 'react',   // filter by title keyword
  afterTimestamp: Date.now() - 7 * 24 * 60 * 60 * 1000, // last 7 days
  conversationIds: ['id1', 'id2'],  // specific conversations only
})

πŸ“Š Plan Compatibility

Plan Built-in Export? This Tool
Free βœ… βœ…
Plus βœ… βœ…
Team ❌ βœ…
Business ❌ βœ…
Enterprise βœ… (Compliance API) βœ…

❓ FAQ

Does it work with ChatGPT Teams/Business? Yes! That's the primary use case. Team and Business plans have no built-in export feature.

Does it send my data to any external server? No. Everything runs locally in your browser. No data leaves your machine. See our Privacy Policy.

How long does a large export take? Depends on the number of conversations. With default settings (concurrency: 3), expect ~100 conversations per minute. A 1,000 conversation export takes about 10 minutes.

Can I export specific conversations? Yes. Use the "Search by title" option in the extension, or pass conversationIds when using the engine directly.

Does it export images and files? The JSON export contains URLs to attached files. These URLs may expire over time. Binary content is not embedded.

Will it work if ChatGPT changes their API? The tool uses ChatGPT's internal API. If they change it, we'll update. Star the repo to stay notified.

πŸ”§ Development

# Install dependencies
bun install

# Build all formats (extension + standalone + userscript + bookmarklet)
bun run build

# Type check
bun run typecheck

# Run tests
bun run test

# Lint
bun run lint

# Package extension as ZIP
bun run package

Project Structure

src/
β”œβ”€β”€ core/                    # Shared export engine
β”‚   β”œβ”€β”€ config.ts            # Configuration types and defaults
β”‚   β”œβ”€β”€ event-emitter.ts     # Typed EventEmitter implementation
β”‚   β”œβ”€β”€ export-engine.ts     # Core export engine
β”‚   β”œβ”€β”€ utils.ts             # Logging and utility functions
β”‚   β”œβ”€β”€ index.ts             # Public API exports
β”‚   └── formatters/          # Export format implementations
β”‚       β”œβ”€β”€ index.ts          # Formatter registry and types
β”‚       β”œβ”€β”€ conversation-parser.ts  # ChatGPT conversation structure parser
β”‚       β”œβ”€β”€ json.ts           # JSON formatter
β”‚       β”œβ”€β”€ markdown.ts       # Markdown formatter
β”‚       β”œβ”€β”€ text.ts           # Plain text formatter
β”‚       └── html.ts           # Self-contained HTML formatter
β”œβ”€β”€ extension/               # Chrome Extension (Manifest V3)
β”‚   β”œβ”€β”€ manifest.json
β”‚   β”œβ”€β”€ background.ts        # Service worker + badge updates
β”‚   β”œβ”€β”€ content.ts           # Content script (runs on chatgpt.com)
β”‚   └── popup/               # Extension popup UI
β”‚       β”œβ”€β”€ popup.html
β”‚       β”œβ”€β”€ popup.css
β”‚       └── popup.ts
β”œβ”€β”€ standalone/              # Console injection IIFE
β”‚   └── inject.ts
└── userscript/              # Tampermonkey/Violentmonkey script
    └── chatgpt-export.user.ts
tests/                       # Vitest test suite

Architecture

  • Multi-target build: Single TypeScript source β†’ 5 output targets
  • IIFE bundles: Each target is a self-contained IIFE (no code splitting)
  • Build tool: Bun + Vite in library mode
  • No runtime dependencies: Everything is bundled at build time

πŸš€ Releasing

# Bump version in package.json, then:
git tag v2.0.0
git push origin main --tags

GitHub Actions will automatically:

  1. Run tests and type checking
  2. Build all formats
  3. Create a GitHub Release with all artifacts
  4. Upload to Chrome Web Store (if secrets configured)

πŸ”’ Privacy

This tool runs entirely in your browser. No data is sent to any external server. We do not collect, store, or transmit any of your conversation data.

See our full Privacy Policy.

βš–οΈ Legal

This tool accesses your own data through your own authenticated browser session. Under GDPR and UK GDPR (Article 15), you have the right to obtain a copy of your personal data.

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/my-feature)
  3. Make your changes with tests
  4. Ensure bun run typecheck && bun run test && bun run build all pass
  5. Submit a pull request

πŸ“„ License

MIT Β© Kyle Tse

About

Export all your ChatGPT conversations to JSON. No extensions, no API keys, no dependencies. Works with Team/Business plans that have no built-in export.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors