Skip to content

Directory Tree Generator

Turn a strict list of relative file paths into a deterministic, copy-ready directory tree without uploading project names or structure.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Paste one complete relative file path per line, keeping every path on the same selected separator style.
  2. 2.Choose forward slash or backslash input and select Unicode or ASCII tree characters, then generate the tree.
  3. 3.Review the node count and full tree, then copy it into documentation, an issue, or a code review.

About Directory Tree Generator

Directory Tree Generator converts a plain list of relative file paths into a structured text tree suitable for README files, issue reports, technical documentation, architecture notes, code reviews, and support messages. Enter one complete file path per line, select the separator used by the input, choose Unicode or ASCII connectors, and generate the result. Parsing, validation, sorting, rendering, and copying all happen in the current browser tab. File names and project structure are not uploaded to Lizely or sent to an external API.

Each input line represents a file, not a directory declaration. Parent directories are inferred from shared path prefixes. For example, src/components/Button.tsx and src/index.ts create one src directory containing a components directory and an index.ts file. A standalone src line means a file named src. Supplying both src and src/index.ts is therefore an explicit file/directory conflict and is rejected. This rule removes the ambiguity that would arise if the same line could sometimes mean a file and sometimes mean a directory.

Separator handling is strict by design. Choose forward slash for paths such as src/lib/parser.ts or backslash for paths such as src\lib\parser.ts. The other separator is rejected anywhere in the run instead of being guessed, replaced, or treated inconsistently. Leading separators, Windows drive-root forms, empty segments created by doubled or trailing separators, the current-directory segment, and parent traversal are rejected. The generator does not normalize a dangerous or ambiguous path into a different path behind the user's back.

Names may contain ordinary spaces and dots. README draft.md, .env.example, archive.v1, and data file.json remain exactly as entered. Names are not trimmed, lowercased, slugified, decoded, or renamed. ASCII control characters, including a bare carriage return, are rejected because they can make a displayed tree misleading or split terminal output. A blank line is also an invalid empty path, including a trailing blank line after the final entry. Fix the indicated line and generate again rather than expecting invalid entries to be skipped.

The output always begins with a single dot representing the displayed root. Directories are listed before files at each level. Within those two groups, names are ordered by deterministic UTF-16 code-unit comparison rather than browser locale, operating-system collation, input order, modification time, or filesystem metadata. This makes the same accepted input produce the same output in supported browsers. The tool never reads a local folder and cannot know whether a typed path exists on disk.

Unicode mode uses box-drawing connectors such as ├──, └──, and │. ASCII mode uses |--, `--, and | so the tree remains suitable for systems or documents that do not display box-drawing characters reliably. Both modes calculate whether each node is the final child and extend parent prefixes correctly through nested levels. Changing the connector style regenerates only when you select Generate tree again; any earlier output is cleared immediately so it cannot be mistaken for the current settings.

The limits are explicit and non-truncating. Input may contain at most 100,000 UTF-16 code units and 2,000 path lines. Each path may contain at most 128 segments, and each segment may contain at most 255 UTF-16 code units. Rendered output has an independent 500,000-code-unit ceiling because deep prefixes can make a tree much larger than its source list. Every exact boundary is accepted; the next unit, entry, segment, or output character is rejected with an error. No first-N subset, shortened name, sampled branch, or partial tree is returned.

Duplicate paths are rejected rather than silently deduplicated. A path is also rejected if an earlier line already declares one of its prefixes as a file, or if the new line tries to declare as a file a prefix that already contains children. These checks operate on exact JavaScript strings, so case variants remain distinct because case sensitivity differs across real filesystems. The generator does not claim Windows, macOS, or Linux filename validity beyond the disclosed cross-platform safety rules.

Editing input or changing the separator or output style immediately clears the prior tree, error, summary, and copy status. A failed generation never leaves an older successful tree visible. Copy uses the browser clipboard asynchronously. A generation token and mounted-state guard ensure that editing settings, starting another copy, or leaving the page prevents a late clipboard promise from publishing a stale Copied message. If clipboard permission is unavailable, the complete output remains visible and selectable for manual copying.

Use the result as documentation, then review it before publishing. Project trees can reveal internal module names, customer names, deployment layouts, or security-sensitive filenames even when file contents are absent. This tool does not redact secrets, inspect ignore files, label symlinks, calculate sizes, add file comments, discover permissions, or compare a typed list with a real repository. It is a deterministic text transformer, not a filesystem scanner, archive reader, security analyzer, or source-control client.

Methodology & sources

Reject empty input and input above 100,000 UTF-16 code units. Split on line feed, remove the single carriage return in each CRLF line ending, and accept at most 2,000 file paths. Under the selected separator, reject absolute paths, drive-root forms, the opposite separator, empty segments, dot and parent segments, other ASCII controls, more than 128 segments per entry, or segments above 255 code units. Insert exact segments into an in-memory prefix tree while rejecting duplicate leaves and both directions of file/directory conflict. At each level, list directories before files and compare names by UTF-16 code units. Render from a dot root with correct last-child prefixes using fixed Unicode or ASCII connectors, aborting rather than truncating if output would exceed 500,000 code units. Input or setting changes clear derived state, while clipboard generation and mount guards prevent stale status.

Frequently asked questions

Can Directory Tree Generator scan a folder on my computer?
No. It only transforms paths you paste. It does not request folder access, read file contents, inspect metadata, or verify that a path exists.
Why are duplicate paths and file/directory conflicts rejected?
Each line declares a file. Silently merging a duplicate or treating one declared file as a directory would change the meaning of the input, so the tool reports the conflicting line instead.
What is the difference between Unicode and ASCII output?
Unicode uses box-drawing characters for clearer branches. ASCII uses ordinary keyboard characters for environments where box-drawing glyphs may not display reliably. Structure and ordering are identical.
Are spaces, dots, and case preserved in names?
Yes. Ordinary spaces, dots, leading dots, and letter case are preserved exactly. Control characters, empty segments, dot traversal segments, absolute paths, and mixed separators are rejected.
Is my project structure uploaded?
No. Validation, tree construction, sorting, output rendering, and clipboard writing run locally in the current browser tab.

Developer Tools guides

View all