Skip to content
yutils
Example

Input (indented paths)

src
  app
    page.tsx
    layout.tsx
  components
    Header.tsx
  lib
    tools.ts

Output (ASCII tree)

src
├── app
│   ├── page.tsx
│   └── layout.tsx
├── components
│   └── Header.tsx
└── lib
    └── tools.ts

Note

Indent with 2 or 4 spaces and the hierarchy turns into `├──` / `└──` tree characters. Perfect for README directory structures.

Usage / FAQ

When to use

  • Visualize directory structure in a README
  • Show folder trees in tech docs or wiki pages
  • Attach an affected-files tree to a PR description
  • Sketch information architecture in design docs
  • Include a directory tree in an AI prompt

FAQ

Q.Can I mix tabs and spaces?
A.Not recommended. The indent unit is inferred from the first line — stick to a consistent 2-space or 4-space style.
Q.How do I distinguish directories from files?
A.Text is rendered as-is. Add a `/` suffix or an emoji like `📁` in the input and it carries through to the output.
Q.Is the output safe to paste into GitHub markdown?
A.Yes — pure ASCII, so wrapping it in a fenced code block renders identically everywhere.
Fun facts
  • Tree-drawing characters like ├ │ └ ─ live in Unicode 1.0's (1991) 'Box Drawing' block (U+2500 – U+257F) — 128 characters in total. Before Unicode, IBM Code Page 437 (1981 PC) was the de facto standard for single- and double-line drawing — Unicode rolled that intent forward directly.

    Wikipedia — Box-drawing characters
  • DOS's `tree` command shipped in MS-DOS 3.2 (1986) — the first widely-available tool that visualized directory structure as an ASCII tree. Windows and Linux's same-named commands inherited the convention; the output shape of 'C:\>tree' has stayed essentially unchanged for 40 years.

    Wikipedia — tree command
  • Git's `git log --graph` uses the same box-drawing characters to render branch and merge history as an ASCII graph — `*` for commits, `| / \` for branches and merges. A powerful trick that lets a plain terminal show commit topology at a glance, no GUI required.

    Git — log documentation