Generate directory tree structure from text input or file paths. Support for various formats and custom options.
Features
- Visual Tree Structure: Generate clear directory trees using ASCII characters (├──, └──, │) to visualize file system hierarchies with proper indentation and branch connections
- Multiple Output Formats: Support for various formats including ASCII art, Unicode box-drawing, Markdown-style indentation, and plain text suitable for README documentation
- Customizable Options: Configure tree characters, indentation width, file/folder icons, sorting rules, and filter options to match your documentation style
- One-Click Copy: Instantly copy generated tree structure to clipboard for pasting into README files, documentation, or code comments
Usage Guide
- Step 1: Enter directory paths or file structure.
- Step 2: Generate directory tree.
- Step 3: Copy the generated tree.
Technical Details
Tree Structure Representation
Directory tree representation uses ASCII characters (│, ├, └, ─) to visualize hierarchical file system structures. Each level of nesting is indicated by indentation and connecting lines, creating a clear parent-child relationship. The tree format follows Unix 'tree' command conventions, using box-drawing characters to represent branches and connections, making complex directory structures easily readable and suitable for documentation.
Path Parsing and Hierarchy Building
The generator parses file paths by splitting them on directory separators (/ or \), building a tree data structure from nested paths. Each path segment becomes a node, with children nodes sorted alphabetically or by custom rules. The algorithm handles edge cases like duplicate paths, empty directories, and special characters. It constructs the hierarchy using depth-first or breadth-first traversal, ensuring proper nesting relationships.
Output Formatting Options
Tree output supports multiple formats including ASCII art (using ├──, └──, │), Unicode box-drawing characters, indentation-only (Markdown style), and JSON/XML structured formats. Customization options control branch characters, indentation width, file/folder icons, color coding for different file types, and whether to show hidden files. The formatter can also generate clickable trees for HTML documentation or plain text for README files.
Frequently Asked Questions
- How should I format the input text?
- Place each folder or file path on its own line and use two spaces or a tab to indent nested levels. The generator detects indentation automatically whether you paste text or upload a file.
- Can I import an actual project structure quickly?
- Yes. Run commands such as `tree -F -I node_modules` or `find . -maxdepth 4` in your terminal, copy the output and paste it here, or drop a text/Markdown file that contains the listing. The tool rebuilds the hierarchy instantly.
- How do I keep the generated tree tidy in documentation?
- Limit the depth before copying, hide large folders like `dist` or `node_modules`, and wrap the result inside a ```text code block in your README so the ASCII branches stay aligned.
Related Documentation
- Unix tree Command Manual - Official documentation for Unix/Linux tree command showing standard format for directory structure visualization
- ASCII Art Character Reference - Complete reference for ASCII box-drawing characters used in tree structures
- Markdown Documentation Best Practices - Guide for using directory tree structures in README files
- Filesystem Hierarchy Standard - Standard directory structure for Linux and Unix systems
- Project Documentation Best Practices - Guide on how to effectively document and visualize project structure