On Windows, run tree /F /S /A in Command Prompt from the folder you want to inspect to print a recursive tree of directories and files.
The native command is best when the result must reflect the current contents of a folder. If you already have a list of relative file paths and need consistent text for a README, issue, code review, or support message, Directory Tree Generator provides a separate text-transformation workflow. It does not scan the folder.

Choose a Windows workflow that matches the source
Windows can show a live directory tree directly, while a browser-based generator can turn an existing path list into deterministic text. These approaches answer slightly different tasks.
| Method | Source | Reads the disk | Best for |
|---|---|---|---|
| Command Prompt tree command | The current or named folder | Yes | Inspecting the actual Windows folder structure |
| Directory Tree Generator | A pasted list of relative file paths | No | Creating deterministic documentation from an existing list |
Use the native command when files may have changed since your list was prepared. Use the path-list workflow when the exact submitted paths matter more than discovering what is currently on disk.
Run the native tree command
Open Command Prompt at the folder you want to inspect, then use the recursive command with file names and ASCII branches included.
- Press Win+R, type cmd, and press Enter to open Command Prompt.
- Change to the target directory with cd /d "C:\Work\My Project". Keep the quotation marks when the path contains spaces. The /d option also changes the current drive when necessary.
- Alternatively, open the target folder in File Explorer, click the address bar, type cmd, and press Enter. This opens Command Prompt with that folder already selected.
- Run tree /F /S /A. The tree will display beneath the command in the console.
- To inspect another folder without changing directories, run tree "C:\Work\My Project" /F /S /A.
- /F includes file names in the displayed directories.
- /S includes the contents of subdirectories.
- /A uses ASCII branch characters instead of extended box-drawing characters.
Use tree /F /S when Unicode connectors display reliably in the console or destination document. The ASCII form is easier to preserve in systems that do not render box-drawing characters consistently.
Save the result as plain text
Console output can disappear when the window closes, so redirect it when the tree needs to be shared or reviewed later.
- From the target folder, run tree /F /S /A > directory-tree.txt.
- Open directory-tree.txt in a text editor. The file is created in the current folder, and redirection replaces an existing file with the same name.
- Review the text, then copy the relevant portion into a README, issue, architecture note, code review, or support message.
To write the file somewhere else, provide a quoted destination, such as tree /F /S /A > "C:\Users\Alex\Desktop\directory-tree.txt". Native Command Prompt output can include heading lines, whereas Directory Tree Generator always presents its own tree from a single dot root.
Build a tree from a relative path list
When the paths already exist in a list, open the folder containing that list in Command Prompt and create a recursive file-path file with dir /S /B /A-D > paths.txt. The dir /S /B /A-D command outputs fully qualified paths such as C:\Work\project\file.txt, which Directory Tree Generator rejects; convert every entry to a complete relative file path before pasting. It does not create directory-declaration lines, so the generator must infer parent directories from shared prefixes.
- Prepare the input with one complete relative file path per line. For example, use src/index.ts and src/components/Button.tsx, but do not add a standalone directory line for src.
- Open Directory Tree Generator and paste the complete list into its input area.
- Select the separator used by the pasted paths: choose forward slash for entries such as src/lib/parser.ts, or backslash for entries such as src\lib\parser.ts.
- Select Unicode connectors for box-drawing characters such as ├── and └──, or ASCII connectors for |-- and `--.
- Select Generate tree. The tool validates, sorts, constructs, and renders the result in the current browser tab.
- Review the node count and full tree, then copy it into documentation, an issue, or a code review.
Editing the input or changing the separator or output style clears the previous tree, error, summary, and copy status. Generate the tree again after making a change so the displayed result always corresponds to the current settings.
Keep every input path unambiguous
Every input line represents a file, not a directory declaration. Shared prefixes create parent directories automatically. A standalone line such as src therefore means a file named src; combining it with src/index.ts creates a file/directory conflict and is rejected.
- Use relative paths only. Leading separators and Windows drive-root forms are rejected.
- Use one separator style throughout. The opposite separator is rejected anywhere in the run rather than converted automatically.
- Reject doubled or trailing separators because they create empty path segments.
- Reject current-directory and parent-traversal segments such as . and ...
- Remove blank lines, including a trailing blank line after the final entry. ASCII control characters, including a bare carriage return, are also rejected.
- Remove duplicate paths. Case variants remain distinct because validation compares exact strings.
- Resolve file/directory conflicts in either direction: a path cannot be both a declared file and a parent of other entries.
Ordinary spaces, dots, leading dots, and letter case are preserved exactly. Names are not trimmed, lowercased, slugified, decoded, or renamed, so README draft.md, .env.example, and data file.json remain distinct from differently spaced or cased names.
Understand the generated structure
The output always begins with a single dot representing the displayed root. Directories appear before files at every level. Within the directory group and the file group, names are ordered by UTF-16 code-unit comparison rather than browser locale, operating-system collation, input order, modification time, or filesystem metadata. The same accepted input therefore produces the same structure in supported browsers.
Unicode and ASCII modes use the same ordering and hierarchy; only their branch characters differ. Changing the connector style does not regenerate the tree automatically. The previous output is cleared immediately, and Generate tree must be selected again. A failed generation does not leave an older successful tree visible. If browser clipboard permission is unavailable, the complete output remains visible and selectable for manual copying.
Respect the input and output limits
| Limit | Maximum | Applies to |
|---|---|---|
| Total input | 100,000 UTF-16 code units | The entire pasted list |
| Path lines | 2,000 | One declared file path per line |
| Segments per path | 128 | Each individual path |
| Length per segment | 255 UTF-16 code units | Each individual path segment |
| Rendered output | 500,000 code units | The generated tree |
Every exact boundary is accepted, while the next unit, entry, segment, or output character is rejected. The output ceiling is independent because deep directory prefixes can make a rendered tree much larger than its source list. No shortened names, sampled branches, first-N subset, or partial tree is returned. Empty input is also rejected.
Review before sharing the result
Parsing, validation, sorting, rendering, and copying happen in the current browser tab. File names and project structure are not uploaded to Lizely or sent to an external API. Nevertheless, a tree can disclose internal module names, customer names, deployment layouts, or security-sensitive filenames, so review it before publishing.
The generator cannot verify that a typed path exists, read a local folder, inspect ignore files, label symbolic links, calculate sizes, discover permissions, or compare the list with a real repository. Its validation ensures unambiguous text input rather than certifying that every name is legal on a particular Windows filesystem. Use the result as documentation, then remove or redact sensitive names before sharing when necessary.