Combine Files Into One Text for AIMerge a folder into one prompt-ready file and check its token count
Drag in a folder and get one text with each file's path as a heading. Choose which files to leave out, then check the estimated token count before you paste it into ChatGPT, Claude, or Gemini.
This tool runs entirely in your browser. What you enter is never sent anywhere.Your input is never sent anywhere.
DetailsDrag and drop a folder here
or
Works best in Chrome and Edge. If drag and drop doesn't work in your browser, use Choose Folder.
Paste a Whole Project Into an AI Chat Without Copying File by File
Asking ChatGPT, Claude, or Gemini to review a project means pasting a lot of files. Doing it one at a time is slow, and it is easy to lose track of what you already pasted or to drop the file names, so the model can't tell you which file a problem is in.
This tool reads a folder in your browser and joins its files into one text, with each file's path as a heading. Folders such as node_modules and .git, lock files, binary files, secret files like .env, and files over the size limit are skipped by default. You can switch any file on or off by hand.
It also shows an estimated token count and compares it with common context window sizes, so you can see whether the text will fit before you paste it.
When a Single Combined Text Helps
Code review with the whole project in view
Combine your src folder and ask the model to review it with the full context. Every file starts with its path, so the replies can point to a specific file.
Debugging an error that spans several files
Select only the files involved in the stack trace, leave out tests and generated code, and paste them with the error message.
Summarizing notes, specs, or meeting minutes
Combine a folder of Markdown or text documents, then ask for a summary, a list of open questions, or contradictions between documents.
Checking size before you paste
See the token estimate next to common limits, find the largest files in the Top 5 list, and trim until the text fits with room to spare.
From Folder to Pasted Prompt in 4 Steps
- Drag a folder onto the drop area, or click Choose Folder.
- Check the settings. Add extensions or path keywords to skip, adjust the size limit per file, and turn the file tree on if you want it.
- Review the file list. Click a file to include or exclude it.
- Pick divider lines or Markdown, check the token estimate, then copy the text or download it as a .txt file.
Note: Files are read in your browser. Their contents are not sent to a server.
Limits and Things to Check
- The token count is an estimate (about 4 characters per token for ASCII text, about 1.8 for other characters). The real count depends on the model's tokenizer.
- Binary files are detected by extension only. If a binary file with an unusual extension gets through, add that extension to the exclude list.
- Secret files are skipped by name and extension, such as .env and .pem. Keys or passwords inside other files are not detected, so scan the preview before you paste.
- Files over the size limit (500 KB by default) are skipped. Clicking a skipped file adds it back.
Context Window Sizes to Compare Against
Use these figures to judge your token estimate. Limits change with model version and plan, so check your provider's documentation for the exact number.
| Model family | Context window | Roughly in English words |
|---|---|---|
| GPT-4o | 128K tokens | About 96,000 words |
| GPT-4.1 | 1M tokens | About 750,000 words |
| Claude | 200K tokens | About 150,000 words |
| Gemini 1.5 Flash | 1M tokens | About 750,000 words |
| Gemini 1.5 Pro | 2M tokens | About 1.5 million words |
Code and non-English text use more tokens per character.
A common rule of thumb for English prose is 1 token to about 4 characters, or about 0.75 words. Languages such as Japanese and text with many symbols usually take more tokens for the same number of characters, so leave extra room for them.
The word counts are approximate conversions for English text. Some models and plans offer larger windows than the figures shown here.
Preparing a Folder for an AI Prompt
A few choices decide whether the model gets useful context or just noise.
Start each file with its path
If file contents are simply stuck together, the model can't tell where one file ends and the next begins.
A path header such as src/components/Header.tsx lets it say "in this file, this function" instead of guessing.
The tool adds that header for you, either as a divider line (===== path =====) or as a Markdown heading with a fenced code block.
Why node_modules wrecks your token budget
Merging a Node.js project as-is pulls in every dependency under node_modules, which can run to millions of characters.
The text then blows past the context window, and your own code is the part that gets cut off or rejected.
The skip option for common build and dependency folders is on by default to prevent this.
Add a file tree for orientation
Turning on Add a file tree at the top puts a folder tree of the included files before the code. The model sees the layout first, which helps with questions about how files relate to each other. The tree only lists files you included, so it stays in step with your selection.
Treat the token count as a guide, not a guarantee
Each model splits text with its own tokenizer, so no estimate will match every service exactly.
The number here is a rough estimate. Instead of aiming right at the limit, leave a margin of 10 to 20 percent when you choose files.
Check for secrets before you paste
Pasting a .env file or a config file with credentials sends those secrets to a third-party service.
The tool skips common secret files by default, but it can't see inside other files. Read the file list and the preview, and click any file you don't want included.
Common Mistakes and How to Fix Them
The whole project root was merged, dependencies included
The skip option was off, or the root folder was loaded without checking the file count, and the token estimate jumped far past the limit with your own code lost in the pile.
💡 See the solution▼
A .env file or credentials got pasted into the chat
A file with API keys or database passwords was included and pasted without a second look.
💡 See the solution▼
A binary file turned into garbled text
A file with an unusual extension was read as text, so part of the output is unreadable and the model misreads it or rejects the paste.
💡 See the solution▼
Too many loosely related files
Hundreds of files went in, and the model lost track of what mattered and gave a vague or off-target answer.
💡 See the solution▼
FAQ: File Types, Exclusions, Tokens, and Browsers
Q.What types of files can I combine?
A. Any text-based file: source code, Markdown, JSON, YAML, CSS, HTML, plain text, and similar. Binary files are skipped by file extension because they would turn into garbled text. That covers images, video, audio, archives, PDFs, Word/Excel/PowerPoint files, fonts, executables, and database files. They stay in the list with a "Binary file, skipped" label.
Q.Do I have to exclude node_modules and build folders myself?
A. No. With "Skip common build and dependency files" on, the tool leaves out any folder named node_modules, .git, .next, .nuxt, dist, build, out, .vercel, .turbo, coverage, .cache, .idea, __pycache__, .pytest_cache, venv, or .venv, at any depth. It also skips package-lock.json, yarn.lock, pnpm-lock.yaml, .DS_Store, and Thumbs.db. Because the match is by folder name, a source folder that happens to be called build or out is skipped too. Click the file to bring it back, or turn the option off.
Q.How accurate is the token count?
A. It is a rough estimate. The tool counts about 4 characters per token for ASCII text (English and most code) and about 1.8 characters per token for other characters, such as Japanese or emoji. Real tokenizers differ by model, so the actual count can be higher or lower. Use it to see whether your text is far under or far over a limit, and leave a margin if it is close.
Q.How do I include or exclude a single file?
A. Click its row in the file list. A manual choice always overrides the automatic rules, so you can bring back a file the rules skipped or drop one they kept. "Include all" and "Exclude all" apply to the files currently shown, so you can filter by name first. "Reset to rules" clears every manual choice.
Q.Will my .env file or API keys end up in the output?
A. By default, no. With "Skip .env and key files" on, the tool skips .env, .env.* files (except .env.example, .env.sample, and .env.template), and files ending in .env, .pem, .key, .p12, or .pfx. It cannot detect keys or passwords written inside other files, such as a config.json or a source file, so read through the file list and the preview before you paste anything.
Q.Is my code uploaded anywhere?
A. No. The files are read and joined in your browser, and the tool does not send their contents to a server. Once you paste the text into an AI service, that service's own privacy terms apply.
Q.Which format should I choose: divider lines or Markdown?
A. Both put the file path before each file's content. Divider lines use a header like ===== src/App.tsx ===== and add the least extra text. Markdown uses a ## heading with the path and wraps the content in a fenced code block labeled with the language, which suits chat tools that render Markdown. If the files themselves contain triple backticks, divider lines are the safer choice.
Q.Which browsers are supported?
A. Chrome and Edge are the best fit for dragging and dropping a folder. In Safari and Firefox, use the Choose Folder button. If a folder doesn't load, try it in Chrome or Edge.
Q.Can it handle a large project?
A. Folders with hundreds or thousands of files usually load, but the file list and the combined text take longer to build as the folder grows, and speed depends on your device. Load the subfolder you need, keep the skip option on, and use the "Top 5 files by tokens" list to find files that take up the most space.
Your feedback
makes this tool better.
Tell us which features you'd like, what should be fixed, or which new tool you'd like to see. An engineer reads every submission and uses it to guide development.