How to use Folder Tree Generator
Choose a local folder or switch to Paste paths, then click Generate. Folder mode uses the selected file names and relative paths; Paste paths builds missing parent folders from each line. The result can include a root label, branch connectors, folder markers, counts, and downloadable files.
- Choose Select folder and click Choose folder, or switch to Paste paths and enter one relative path per line.
- Click Generate after selecting a folder or entering paths.
- Set Branch style, Markers, Order, Hidden files (dotfiles), Depth limit (0 = unlimited), or the pattern fields.
- Review Nodes, Files, Folders, and Max depth, then choose Copy, TXT, CSV, or JSON.
Generate a tree from a folder or paths
In Paste paths, a trailing slash marks a folder. Every other non-empty line is treated as a file path, and intermediate folders are inferred.
src/index.js
src/components/Button.jsx
docs/
README.md
root
|-- docs/
|-- src/
| |-- components/
| `-- index.js
`-- README.md
With ASCII connectors and trailing folder markers, the paths above produce the sample tree. Blank lines are ignored. Backslashes become slashes, and leading slashes are removed. A path with a .. segment or a drive letter is rejected with its line number.
Choose branch, marker, and depth settings
Branch style selects Unicode branch characters or ASCII connectors such as |-- and `--. Markers can be None, Trailing slash on folders, or [DIR] / [FILE] labels. Show root label includes the root node. When it is enabled, Root label text (optional override) changes the displayed root name if you enter one.
Order keeps the encountered order or sorts naturally with folders before files. Depth limit (0 = unlimited) clears descendants below the selected depth. Hidden files (dotfiles) excludes path segments whose names start with ..
Filter entries and export the result
Include patterns (comma-separated, * ?) keeps files whose names or relative paths match one of the patterns. Exclude patterns (comma-separated, * ?) removes matching files. Both fields ignore letter case. In folder mode, the browser supplies file entries, so empty folders do not appear. Add an empty folder in Paste paths with a trailing slash.
An empty folder selection or empty Paste paths input leaves the workspace hidden. If folder selection is unavailable, switch to Paste paths. TXT contains the rendered tree. CSV and JSON contain the filtered, depth-limited manifest with path, type, and depth. When filters remove every child entry, the count cards show zero; with Show root label enabled, the output still contains the root label.
Examples with Copy, patterns, and depth
- To place a repository tree in a README, select the folder, choose the branch and marker styles, then choose Copy.
- To keep Markdown files, enter
*.mdin Include patterns (comma-separated, * ?) and choose JSON. - To keep only the upper levels, set Depth limit (0 = unlimited) and choose TXT.
When to use the file management generate tools
Use this page when the output should show names and hierarchy. Browse the File Management Generate Tools category for another file or folder generation task. The page makes no network request with selected names or pasted paths. It never reads file contents or writes back to the selected folder.
Frequently asked questions
How do I generate a directory tree from pasted paths?
Switch to Paste paths, enter one relative path per line, and click Generate. Add a trailing slash for a folder, including an empty folder.
Can I create an ASCII directory tree instead of Unicode?
Yes. Set Branch style to ASCII before clicking Generate. The output uses connectors such as |-- and `--.
Does Folder Tree Generator read file contents?
No. It reads file names and relative paths only. It does not upload them or modify the selected folder.
Why are paths with .. rejected?
Paths containing a .. segment are rejected because they can point outside the pasted tree. The error identifies the line so you can replace it with a self-contained relative path.