Documentation
Repo2Txt Docs
1. Getting started
Repo2Txt is a 100% client-side tool that converts a local codebase into a single text file optimized for pasting into LLM chat interfaces (Claude, Gemini, ChatGPT, etc.).
To use it:
- Go to the tool page.
- Click the dropzone or drag-and-drop a project folder.
- Wait 1–3 seconds for the conversion to complete.
- Review the output, then click Copy or Download.
- Paste the result into your favorite AI chat.
That's it. No signup, no upload, no configuration required. The defaults work for 99% of repositories.
2. Filters & exclusions
Repo2Txt applies three layers of filtering, in order:
Layer 1: Hardcoded exclusions
Dependency folders (node_modules, target, .venv,vendor, __pycache__, etc.), lockfiles (package-lock.json,yarn.lock, Cargo.lock, etc.), and 100+ binary/asset extensions (images, videos, archives, fonts, databases) are automatically excluded.
You can disable this in Settings, but it's not recommended — these files bloat your context with irrelevant content.
Layer 2: .gitignore parsing
Repo2Txt parses .gitignore files at every directory level — not just the repo root. This means monorepos with per-package ignore rules work correctly. Full gitignore syntax is supported: negations (!), anchoring (/), directory-only (trailing /), *, ?, and **.
Layer 3: Binary & minified detection
Files that slipped through the first two layers are checked with a binary-detection heuristic (NUL byte in first 2KB) and a minified-detection heuristic (average line length ≥ 500 chars). Matches are skipped automatically.
Custom exclusions & inclusions
Open Settings to add your own glob patterns. Custom exclusions use gitignore-style globs (*.test.ts, docs/**, apps/*/dist/**). Custom inclusions override all other exclusion rules — useful for keeping .env.example files while still excluding real .env files.
3. Output formats
Repo2Txt supports four output formats, switchable instantly in the output panel:
| Format | Extension | Best for |
|---|---|---|
| Plain Text | .txt | Terminals, simple chatboxes that don't render markdown |
| Markdown | .md | Gemini, ChatGPT, GitHub, most chat UIs (default) |
| JSON | .json | Programmatic pipelines, RAG ingestion, scripts |
| LLM Chat | .txt | Natural-language message for Claude/GPT/Gemini chat windows |
All four formats are generated from the same in-memory file list, so switching is instant — no re-processing required.
4. Token estimation
Each file's token count is estimated using a simple heuristic: character count ÷ chars-per-token ratio. The default ratio is 4 (typical for English text), configurable in Settings from 1 to 10.
This is an approximation, not an exact tokenizer. It tends to:
- Overestimate for code (which is denser than prose).
- Underestimate for prose-heavy files (markdown, comments).
For most use cases, the estimate is within ±20% of the actual token count — close enough to tell you whether your repo will fit in a 200K context window.
5. AI model cost estimation
The AI Model Cost Estimator shows real, vendor-verified pricing for 12 latest models. It calculates:
- Input cost — your token count × the model's input price per million tokens.
- Round-trip cost — input cost + estimated output cost (assumes ~30% of input tokens as output).
- Context fit — whether your codebase fits in the model's context window.
Pricing is sourced from official vendor pages (Google, Anthropic, OpenAI, DeepSeek) and is updated periodically. Always verify current pricing with the provider before making purchasing decisions.
6. Keyboard shortcuts
| Shortcut | Action |
|---|---|
Tab | Navigate to the next interactive element |
Enter / Space | Activate the focused element (button, link, checkbox) |
Escape | Close the settings dialog |
Cmd/Ctrl + K | (Future) Open command palette |
Repo2Txt is fully keyboard-accessible. A "Skip to content" link appears at the top of the page when you press Tab for the first time.
7. Self-hosting
Because Repo2Txt is 100% client-side, self-hosting is trivial:
- Clone the repository.
- Run
npm install(orbun install). - Run
npm run buildto produce the standalone output. - Serve the
.next/standalonedirectory from any static file server (nginx, Caddy, GitHub Pages, etc.).
There's no backend to configure, no database to set up, and no environment variables required.
8. Browser support
Repo2Txt works in all modern browsers:
| Browser | Support | Notes |
|---|---|---|
| Chrome 100+ | ✅ Full | Uses File System Access API for directory picker |
| Edge 100+ | ✅ Full | Same as Chrome |
| Firefox 100+ | ✅ Full | Falls back to webkitdirectory input |
| Safari 15.4+ | ✅ Full | Falls back to webkitdirectory input |
| Opera 86+ | ✅ Full | Uses File System Access API |
Internet Explorer is not supported (it lacks modern JavaScript features).
Still have questions?
Check the FAQ or read the blogfor deep dives. If something's still unclear, reach out viaGitHub orX (Twitter).