ToolZoneX
Blog

Folder Structure Generator

Describe a folder tree with indented text or pick a project preset, then get a visual ASCII tree and a copyable mkdir -p / touch shell script to create it.

Folder Structure (indent with spaces, end folders with "/")
ASCII Tree
├── src/
│   ├── components/
│   │   ├── Header.jsx
│   │   └── Footer.jsx
│   ├── utils/
│   │   └── helpers.js
│   ├── App.jsx
│   └── index.js
├── public/
│   └── index.html
├── package.json
└── README.md
Shell Script
#!/bin/sh

mkdir -p "src"
mkdir -p "src/components"
mkdir -p "src/components"
touch "src/components/Header.jsx"
mkdir -p "src/components"
touch "src/components/Footer.jsx"
mkdir -p "src/utils"
mkdir -p "src/utils"
touch "src/utils/helpers.js"
mkdir -p "src"
touch "src/App.jsx"
mkdir -p "src"
touch "src/index.js"
mkdir -p "public"
mkdir -p "public"
touch "public/index.html"
touch "package.json"
touch "README.md"

How to Use the Folder Structure Generator

Choose "Describe Structure" and type your desired folder tree as indented text — one item per line, using leading spaces to show nesting depth, with a trailing "/" marking folders (leave it off for files). Or choose "Use a Preset" to start from a ready-made Node.js, React, or Python project layout. Either way, the tool generates two outputs: a visual ASCII tree using standard tree-drawing characters, and a copyable shell script using mkdir -p and touch that would actually create that structure on a real filesystem.

Example

Typing src/ on one line, then an indented index.js below it, produces an ASCII tree showing src/ with └── index.js nested underneath, and a shell script containing mkdir -p "src" followed by touch "src/index.js".

Common Use Cases

  • Scaffolding a new project's folder layout with a single copy-pasted shell script.
  • Documenting a project's directory structure visually in a README.
  • Quickly starting from a standard Node.js, React, or Python layout instead of typing one from scratch.

FAQs

  • How does the tool know if a line is a folder or a file? Any line ending in a forward slash ("/") is treated as a folder; every other line is treated as a file. Nesting depth is determined by how many leading spaces or tabs a line has compared to the line above it.
  • Will the generated shell script actually work? Yes — it uses mkdir -p for every folder (which also creates any missing parent folders) and touch for every file, so pasting it into a terminal in your target directory recreates the exact structure.
  • Can I customize a preset after selecting it? Not directly in preset mode — switch to "Describe Structure" and paste in a preset's layout as a starting point, then edit the text freely from there.