Project to AI Text
Pick a project folder and get one plain text with its directory tree and the contents of the files you choose, ready to paste into an AI chat. The tool skips build output, dependencies, binary and secret files, follows the project's .gitignore files and estimates the token count. Everything runs in your browser; no file leaves your device.
1. Choose a project folder
Drop a project folder here, or
Files are read only inside this browser tab. Nothing is uploaded, even if the browser's dialog uses the word "upload". Phones and tablets may not offer folders; use Choose files there.
2. Filters
tests/ or *.svg.
Binary files are always left out: files with a binary extension (images, audio, video, archives, fonts, executables, office documents…) are never opened, and other files are checked for binary content when they are read.
3. Files
What was skipped and why
File types
Tick or untick a type to select or deselect all its files at once.
| Include | Type | Files | Size |
|---|
Folders and files
Unticked files are never opened. Use the arrow buttons to open or close a folder.
4. Text for the AI
Loading…
The token figures are estimates: every AI model splits text in its own way. Your files are read locally by this page and are never sent to a server.
How to use the project to AI text tool
- Press Choose folder and pick the top folder of your project, or drop the folder onto the box in step 1. Choose files picks single files instead, which also works on devices that cannot pick folders.
- Check the filters in step 2: generated folders, lock files, likely secret files, binary files and files above the size limit are skipped, and the project's .gitignore files are followed. Add your own patterns if anything else should stay out.
- Look through step 3 and untick folders, single files or whole file types the AI does not need. "What was skipped and why" lists every skipped item with its reason.
- Optionally type your question into Text before the project, then press Create text. Only the ticked files are read.
- Press Copy text and paste the result into your AI chat, or download it as a .md or .txt file. From then on the text follows every change you make.
How it works
The tool walks through the folder from the top, the way version control does. In each folder it first reads the .gitignore file, if there is one, and then checks every entry in this order: common generated folder or system file, .gitignore rules and your extra patterns, lock file, likely secret file, binary extension, size limit. The first check that matches is the reason shown in the skipped list. With the direct folder picker or drag and drop, a skipped folder is not even opened, so a huge dependency folder costs almost nothing.
When you create the text, each ticked file is read once. If its first 8,000 bytes contain a zero byte, or more than 10% of them are control characters, it is marked "binary, skipped". Text is decoded as UTF-8, a byte order mark is dropped and CR LF line endings become LF. The result has a header, the directory tree and one block per file:
### src/notes.js
```javascript
const notes = [];
…
```
The fence is three backticks, or one more than the longest run of backticks inside the file,
so a Markdown file with its own code fences cannot break the block. The language hint comes
from the extension (.py gives python) or from names such as
Dockerfile; unknown types get text.
The token estimates are T₁ = C ÷ 4 and T₂ = W × 4 ÷ 3, rounded to
whole numbers. C is the number of characters (Unicode code points) in the whole
text and W the number of words, counted as runs of characters between spaces or
line breaks. Both follow the rule of thumb that a token is about four characters, or three
quarters of an English word. Every model has its own tokenizer, so these are estimates. For
code T₁ is usually the more realistic one: a single "word" such as
notes.push(note); splits into several tokens.
Examples
Example 1 – the built-in example project. demo-notes-app holds
14 files. Six are skipped: dist/ and node_modules/ (generated
folders), debug.log (rule *.log in .gitignore), .env
(likely secret), package-lock.json (lock file) and public/logo.png
(binary extension). The other eight files give 2,091 characters and 270 words, so
T₁ = 2,091 ÷ 4 ≈ 523 and T₂ = 270 × 4 ÷ 3 = 360 tokens.
Example 2 – keeping a lock file. Untick "Skip lock files" and package-lock.json joins: 9 files, 2,226 characters, about 557 tokens. Real lock files are long and rarely help an AI, which is why they are skipped by default.
Example 3 – an extra pattern. With lock files skipped again, add the line
tests/ to the extra patterns. The tests folder leaves the list: 7 files, 1,755
characters, about 439 tokens.
Example 4 – a longer fence. The example README.md contains its own
```bash block, so the tool wraps that file in four backticks.
.gitignore patterns this tool understands
The tool implements the common part of the .gitignore syntax. Every pattern below was checked against version control's own ignore check on the same files:
| Pattern | Skips | Keeps |
|---|---|---|
*.log | app.log, sub/x.log | log.txt |
/todo.txt | todo.txt | sub/todo.txt |
out/ | folders out, sub/out | a file named out |
doc/*.txt | doc/a.txt | doc/api/b.txt |
doc/**/*.txt | doc/a.txt, doc/api/b.txt | docs/a.txt |
logs/** + !logs/keep.md | logs/a.txt | logs/keep.md |
- Lines starting with
#are comments; write\#or\!for names that start with those characters. Trailing spaces are dropped unless escaped. *matches any characters except/,?one such character, and[abc],[a-z]or[!a-z]one character from a set.- A slash at the start or in the middle ties the pattern to the folder of its .gitignore; without one it matches at any depth. A trailing slash matches folders only.
**/at the start means "in any folder",/**at the end "everything inside" and/**/"zero or more folders".!brings back a path excluded earlier, but not a file whose parent folder is excluded. The last matching line wins, deeper .gitignore files win over higher ones, and your extra patterns are applied last.
Not read: global exclude settings, the repository's own exclude file and .gitignore files
above the chosen folder. The tool sees only the folder, so files that version control tracks
despite a matching pattern are skipped here too. Matching is case-sensitive:
*.LOG does not skip app.log.
Tips for giving a codebase to an AI
- Send what the question needs: the folders involved plus the README and main configuration are often enough, and smaller input gets more focused answers.
- Keep secrets out. The secret filter checks names only, so look for passwords, keys and tokens inside configuration files and code before you paste.
- Context limits differ between models; if the text is too long, send it folder by folder and say that more parts follow.
- Turn on line numbers when you want answers that point to exact lines.
Frequently asked questions
Why does the browser say it will upload the files?
The classic folder dialog is the one used for uploads, so some browsers ask "upload these files?". Here the files only go to this page in your own tab.
How accurate is the token estimate?
It is a rough guide. Tokenizers differ between models, and code, non-English text and long numbers usually need more tokens than the word-based figure suggests.
Why is a file missing from the list?
Open "What was skipped and why" in step 3: every skipped item is listed with the filter or the exact .gitignore line that removed it.
Which file encodings are supported?
Files are read as UTF-8, which includes plain ASCII. Other encodings show replacement characters for accented letters, and UTF-16 files contain zero bytes, so they count as binary.
Can I use it on a phone?
Yes, with Choose files: the picked files are placed side by side without folders. Folder picking and drag and drop work best on a computer.
Is my code uploaded or stored anywhere?
No. The folder is read by JavaScript in this tab and the text is built in memory. Only your filter settings and the text before the project are remembered in this browser's local storage; files and results are gone when you close the tab.
Related tools
- Word Counter – count the words and characters of any text.
- JSON Formatter – format and check JSON before you paste it.
- Regex Tester – test regular expressions against sample text.
- List Compare – compare two lists, for example two file lists, and see what differs.
- CSV to JSON Converter – turn CSV data into JSON for code or a prompt.