Folder Tree Generator
Create a clean directory tree like the one the tree command prints, ready to paste into a README, a pull request or documentation. Choose a folder on your computer or type an indented list; only file names are read and nothing is uploaded.
Last updated:
Indent with spaces or tabs, end folder names with /, or paste one path per line (src/app/main.js). Output from the tree command is understood too.
How to use the Folder Tree Generator
- Add your structure: type or paste an indented list or a list of paths, or switch to Choose a folder and pick a folder on your computer.
- Set ignore patterns such as node_modules, .git or *.log so build output and clutter stay out of the tree.
- Pick a style: Unicode lines look best on GitHub, ASCII is safest for plain-text files and terminals.
- Fine-tune with a max depth, folders-first sorting, trailing slashes, icons or sizes.
- Copy for README to get the tree wrapped in a ```text code block, or download it as a text file.
Input formats the generator understands
The tool detects the format of the text you paste, so you can start from whatever you already have.
| Format | Example line | How it is read |
|---|---|---|
| Indented list | components/ | More indentation than the line above means “inside it”. Tabs count as four spaces; bullets (-, *) are removed. |
| Paths | src/api/routes.py | Each line is split on / or \; parent folders are created automatically. |
| Existing tree | │ └── main.jsx | Box-drawing and ASCII connectors from tree or tree /A set the level. |
| Folder marker | public/ | A trailing slash marks a folder even when it has nothing listed inside it. |
| Comment | main.jsx # entry point | Text after #, // or <- (with a space before it) is kept as a comment and aligned. |
Ignore pattern cheat sheet
| Pattern | Hides |
|---|---|
node_modules | Any file or folder named node_modules, at every level |
*.log | Every file ending in .log |
build/ | Folders named build (a file called build stays) |
docs/drafts | Only the drafts folder directly inside docs at the top level |
**/temp | temp at any depth (the same as plain temp) |
test_?.py | test_a.py, test_1.py and other single-character matches |
!keep.log | Brings back keep.log after *.log hid it (later rules win) |
Tips for readable project trees
- Show the shape, not every file. A depth of 2 or 3 is usually enough for a README; readers want to know where things live, not every test fixture.
- Explain the important folders with short comments such as
src/ # application code. They are kept and lined up in one column. - Hide generated output such as
dist,build,coverage,.nextand__pycache__, plus lock files if they are not relevant to the reader. - Use a code block. Outside a fenced block, Markdown collapses spaces and the lines no longer meet. Copy for README adds the fence for you.
- Keep it current by pasting the old tree back in, editing it as a list and regenerating.
Frequently asked questions
How do I get a folder tree into my README?
Generate the tree, press Copy for README and paste it into README.md. The tree is wrapped in a fenced code block (```text) so GitHub, GitLab and other Markdown renderers keep the spacing and line characters aligned.
Are my files uploaded when I choose a folder?
No. The browser gives this page the list of file names, paths and sizes inside the folder you pick, and the tree is built in your browser. File contents are never opened and nothing is sent to a server.
Why are empty folders missing when I use Choose a folder?
The standard folder picker only lists files, so a folder with no files inside does not appear. Drag the folder onto the drop box instead: drag and drop reads the folder structure directly and includes empty folders.
How do the ignore patterns work?
They follow .gitignore rules. A name like node_modules matches a file or folder with that name at any level, *.log matches by extension, a trailing slash (build/) matches folders only, a pattern with a slash (docs/drafts) is matched from the top folder, ** matches any number of folders, and ! re-includes something an earlier pattern excluded.
Can I paste the output of the tree command and change it?
Yes. Lines drawn with ├── └── │ or the ASCII form |-- `-- are recognized and rebuilt, so you can paste a tree, then switch the style, sort it, add a depth limit or remove entries with ignore patterns.
What is the difference between the Unicode and ASCII styles?
Unicode uses box-drawing characters (├── └── │) that look like solid lines and match the default output of the Linux tree command. ASCII uses only |, ` and - characters, matching tree --charset=ascii, which is safer for old terminals, code comments and systems without full UTF-8 support.
How do I generate a tree from the command line instead?
On Linux and macOS (after installing it with a package manager) run tree, for example tree -L 2 -I 'node_modules|.git' to limit depth and ignore folders. On Windows, tree /F /A lists files with ASCII characters. Both outputs can be pasted here for cleanup.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.