Developer Tools
Directory Tree Generator
Turn an indented list of files and folders into a clean ASCII tree for README files and docs. Unicode or ASCII connectors, and convert a tree back to a list.
Direction
Paste an indented list of files and folders. One indent step (spaces or a tab) is one level deeper. End a name with a slash to mark it as a folder. The tree updates as you type.
Line style
Box-drawing glyphs, the GitHub README default.
ASCII tree
Your tree appears here. Type an indented file list on the left, or click Load sample.Folders
0
Entries with children or a trailing slash
Files
0
Leaf entries with no children
Tree lines
0
Rows in the rendered tree
How indentation maps to depth
In list-to-tree mode the tool measures the leading whitespace on each line and divides it by the smallest indent it finds, so a 2-space, a 4-space, or a tab outline all produce the same tree without any setting to change. A line nested one step under another becomes its child. Any name that has children, or that ends with a slash, is treated as a folder; everything else is a file.
Pasting back into the tool
Switch to tree-to-list to turn an ASCII tree back into a plain indented outline. This is handy when you have an existing tree from the tree command or a README and want to add a folder, rename a file, or reorder entries, then re-render a clean tree. The connector glyphs are stripped and the depth is rebuilt from the indentation.
How to use
- Keep the direction on List to tree, then type or paste an indented list of files and folders, one per line, using spaces or tabs to show nesting.
- End a name with a slash to mark it as a folder. Any entry that has indented lines below it is treated as a folder automatically.
- Pick Unicode connectors for README files or ASCII connectors for plain terminals, and toggle the trailing slash and alphabetical sorting if you want them.
- Read the rendered tree on the right, with live folder, file, and line counts below, then press Copy to grab the paste-ready text.
- Switch to Tree to list to paste an existing ASCII tree and get a clean indented outline back, ready to edit and turn into a fresh tree.
- Use Clear to reset, or Load sample to see a worked example for the selected direction.
About this tool
Directory Tree Generator turns a plain indented list of files and folders into the clean ASCII tree people paste into README files, GitHub issues, pull request descriptions, documentation, and code comments. You write the structure the natural way, one item per line, using indentation to show nesting, and the tool renders the standard box-drawing connectors so the result looks like the output of the Unix tree command. A line such as src/ with two indented lines below it becomes a folder with two branches, the last item on each level gets the corner connector, and continuing branches keep the vertical pass-through bar so deep trees stay readable. Indentation detection is automatic: the tool measures the leading whitespace on each line and divides by the smallest indent it finds, so a two-space outline, a four-space outline, and a tab-indented outline all produce the same tree with nothing to configure, and mixed tabs and spaces are normalized first. Folders are detected two ways, either by ending a name with a slash or by the simple fact that the entry has children, so you do not have to mark every directory by hand. Options let you choose Unicode box-drawing connectors (the GitHub README default) or a pure-ASCII fallback that uses the portable pipe, hyphen, and backtick characters for terminals and encodings that do not render the box glyphs, toggle the trailing slash that marks directories, and optionally sort each level alphabetically with folders first. A live count shows how many folders, files, and tree lines the result contains. The tool also runs in reverse: paste an existing ASCII tree, the kind the tree command or this generator prints, and the tree-to-list mode strips the connector glyphs and rebuilds a clean indented outline you can edit, reorder, rename, and feed back into the other direction, which makes round-tripping an existing README tree easy. Everything is computed in your browser as you type, so the file and folder names you enter are never uploaded or stored.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
ASCII Box Generator
Wrap text in an ASCII or Unicode box border with title, padding, and alignment.
Open tool
DeveloperASCII Table
Searchable ASCII reference plus a two-way text-to-code converter.
Open tool
GeneratorMarkdown Table Generator
Editable grid, column alignment, paste from spreadsheet, live preview.
Open tool
TextMarkdown TOC Generator
Build a GitHub-style Markdown table of contents from any document.
Open tool
DeveloperJSON Tree Viewer
Collapsible JSON tree with search, JSONPath, type icons, and copy-by-node.
Open tool
DeveloperGitignore Generator
Build a .gitignore from curated language, framework, editor, and OS templates.
Open tool