🌳

Directory Tree Generator

Select a folder and generate a downloadable text directory tree

Directory Tree Generator — what it does

Point the tool at a folder and it walks the entire structure, producing the classic indented text tree — the same format the command-line tree utility prints — ready to download as a TXT file. The browser reads the folder locally through the file API; no listing of your directories ever leaves the machine.

When this tool helps

  • Documenting a project's layout in a README so newcomers can orient themselves.
  • Recording the structure of a delivery or archive before handing it over, as proof of what was included.
  • Reviewing how a downloads or documents folder actually sprawls before reorganising it.

How to use it

  1. Select the folder to map.
  2. Generate the tree.
  3. Review the indented structure on screen.
  4. Download the TXT file.

Accuracy, limits, and good practice

  • Deeply nested folders with thousands of files produce a very long tree; map the subfolder you care about rather than an entire drive.
  • The tree records names and structure only — no file sizes or dates — which keeps it safe to paste into public documentation.
  • Paste the output into a Markdown code block to preserve the alignment; proportional fonts will otherwise mangle the branches.

Frequently asked questions

Are my files read or uploaded?

Only names and folder structure are read, locally, to draw the tree. File contents are never opened and nothing is transmitted.

Why does the browser ask for permission?

Folder access requires an explicit grant — that is the browser's security model working as intended, once per selection.

Can I exclude folders like node_modules?

There is no exclusion filter, so select a subfolder that avoids them, or delete those branches from the text afterwards.

Related tools on this site

Everything above runs inside this page. Directory Tree Generator needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

資料夾目錄樹生成器能做什麼

指定一個資料夾,工具會走訪整個結構,產出經典的縮排文字目錄樹——與命令列 tree 指令相同的格式——並可下載為 TXT。瀏覽器透過檔案 API 在本機讀取資料夾,你的目錄清單不會外流。

什麼時候用得上

  • 在 README 中記錄專案結構,讓新成員快速上手。
  • 交付檔案或封存前記錄目錄結構,作為內容清單的憑據。
  • 整理下載或文件資料夾前,先看清它實際蔓延成什麼樣子。

使用步驟

  1. 選擇要繪製的資料夾。
  2. 產生目錄樹。
  3. 在畫面上檢視縮排結構。
  4. 下載 TXT 檔案。

精確度、限制與實務建議

  • 巢狀很深、檔案上千的資料夾會產出非常長的樹;請針對真正關心的子資料夾,而不是整顆硬碟。
  • 樹只記錄名稱與結構,不含檔案大小或日期,貼進公開文件也安全。
  • 貼到 Markdown 時請放進程式碼區塊以保住對齊,否則比例字型會把分支弄亂。

常見問題

檔案會被讀取或上傳嗎?

只在本機讀取名稱與資料夾結構來畫樹,不會開啟檔案內容,也不會傳送任何資料。

為什麼瀏覽器會跳出權限詢問?

存取資料夾需要明確授權,這是瀏覽器安全機制的正常運作,每次選取都會詢問一次。

可以排除 node_modules 之類的資料夾嗎?

沒有排除過濾器,請改選避開它們的子資料夾,或事後在文字中刪掉那些分支。

本站相關工具

以上步驟全部在這個頁面內完成,資料夾目錄樹生成器 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。