文件格式任意转换助手Transfer Any File

离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser

JSON 转 Markdown——离线、逐行成段、不上传JSON to Markdown offline — a readable dump, no upload

这一条走两步:`json>html` 先把解析后的值序列化成一份**自带样式的查看器**——每个字面量是一个 `<span class="json-line">`,对象与数组各是一个默认展开的 `<details>`,摘要写着 `Object(4)` / `Array(n)`,键、字符串、数字、布尔与 `null` 五类各自着色;接着 `html>md` 用 Turndown 把这份 HTML 写成 Markdown。Markdown 的结果因此由**上一层用了哪些标记**决定,而查看器用的全是 `<div>`、`<span>`、`<details>` 这些 Turndown 没有规则的块,它就把标记摘掉、只留内容。实测一份两层对象的产物形如:`Object(2)` 空行 `{` 空行 `"a": 1,` 空行 `"b": "hi"` 空行 `}`——一行一段、段间一个空行,键与顺序都在,缩进不在(层深由 CSS 的 `margin-left` 表达,不是字符),大括号与逗号作为文字留着。这条页最该说清的一件事就在这儿:**它不会把 JSON 变成文档结构**。没有 `#` 标题、没有 `-` 列表、没有围栏代码块,因为中间那份 HTML 里根本没有 `h1` 到 `h6`、`ul` 或 `pre`;想要一份真正的表格 Markdown,得让数据以 `<table>` 出现,那是 HTML→Markdown 与 Excel→Markdown 那两条路的事。着色与折叠标记不进产物,所以 Markdown 里既没有 `<span>` 也不会带样式表。值本身在解析那一刻定型:数字就是数字、`null` 就是 `null`,`escapeHtml` 只处理写进标记的字符串,产物取的是文字内容。全程离线,两步都在这个标签页里。Two steps: `json>html` first serialises the parsed value into a **self-styled viewer** — every literal is a `<span class="json-line">`, every object and array a `<details>` that opens by default with `Object(4)` / `Array(n)` written in its summary, keys, strings, numbers, booleans and `null` each coloured; then `html>md` runs Turndown over that document. The Markdown is therefore decided by **which markup the layer above used**, and the viewer uses only `<div>`, `<span>` and `<details>` — elements Turndown has no rule for, so it drops the markup and keeps the content. Measured on a two-level object, the artifact reads: `Object(2)`, blank line, `{`, blank line, `"a": 1,`, blank line, `"b": "hi"`, blank line, `}` — one line per paragraph, keys and order intact, indentation absent because the depth lives in CSS `margin-left` rather than in characters, braces and commas surviving as text. That is the one thing this page has to say plainly: **it does not turn JSON into document structure**. There are no `#` headings, no `-` lists and no fenced block, because the intermediate HTML contains no `h1`–`h6`, `ul` or `pre`. For real tabular Markdown the data has to arrive as `<table>`, which is what the HTML to Markdown and Excel to Markdown routes do. Colouring and folding markers do not reach the output, so no `<span>` and no stylesheet comes with it. Values are settled at parse time — a number is a number and `null` is `null` — while `escapeHtml` guards what enters the markup and Markdown takes the text content. Both steps run in this tab, offline.

一批转换结果卡片,含文件名、体积与下载入口
一次混合批量,一个 ZIP 下载One mixed batch, one ZIP download

这条链路怎么走How the route runs

JSONJSON HTMLHTML MarkdownMarkdown

共 2 步,由扩展的路径搜索自动选出,中间产物不落盘。2 steps, chosen by the extension's own path search; intermediate results never touch the disk.

会保留什么What carries over

  • 键名、值与顺序都在:产物按查看器的书写顺序逐行落地,`"a": 1,` 这样的行一句一段Keys, values and order are all there: the artifact follows the viewer line by line, one paragraph per `"a": 1,` line
  • 分组的数量信息留着:`Object(4)` / `Array(n)` 摘要会作为一行文字出现,读得出规模The size information stays: `Object(4)` / `Array(n)` summaries appear as their own line of text
  • 类型体现在字符里:数字不带引号、布尔与 `null` 原样写出,与「从表格里取值」那条一路是字符串不同Types show through the characters: numbers carry no quotes and booleans and `null` are written as themselves, unlike the table route where every value is a string
  • 着色与折叠标记都不进产物:没有 `<span>`、没有内联样式表,Markdown 是纯文本Neither colouring nor folding markers reach the output: no `<span>`, no inline stylesheet — the file is plain text

如实说明的限制What it does not do

  • 不会生成标题、列表或代码块:中间那份 HTML 只有 `div` / `span` / `details`,Turndown 没有可对应到 `#`、`-` 或 ``` 的结构,所以只会摘标记留文字No headings, lists or code fences are produced: the intermediate HTML is only `div` / `span` / `details`, so Turndown has nothing to map onto `#`, `-` or ``` and just strips markup while keeping text
  • 层深不体现在缩进里:查看器的嵌套靠 CSS `margin-left`,产物里只剩先后顺序与大括号,深结构的可读性不如原 JSONDepth does not survive as indentation: the viewer nests through CSS `margin-left`, so the artifact keeps order and braces only, and deep structures read worse than the original JSON
  • 每行一段意味着行与行之间是空行:Markdown 渲染器会把它读成一个个短段落,而不是一整块等宽文本One line per paragraph means blank lines between every line: a renderer shows a run of short paragraphs, not one monospace block
  • 长字符串里的换行与引号按 JSON 语义转义后写入,产物里看到的是那串转义字符,不是重新排版的正文Newlines and quotes inside long strings travel as their JSON escapes, so the artifact shows that escape text rather than re-flowed prose
  • 要真正的表格请用 HTML 或 Excel 那条:只有以 `<table>` 出现的数据才会被写成 GFM 管道表For a real table take the HTML or Excel route: only data that arrives as `<table>` is written as a GFM pipe table

实操提示Working with it

  • 要能再解析回去的漂亮 JSON:直接用 JSON→HTML 或就留在 `.json`,本条不保证可逆To keep JSON that parses back cleanly: use JSON to HTML or leave it as `.json` — this route does not promise reversibility
  • 要贴进文档给人看:如果数据其实是表格,先走 HTML→Markdown,那里有真正的管道表语法To paste into a document: if the data is really a table, go by HTML to Markdown, where the pipe-table syntax exists
  • 只想读结构而不必留档:工作台里的 JSON 树视图带搜索与表视图,比一份 Markdown 更趁手To read structure without filing it: the workbench JSON tree view has search and a table projection, which is handier than a Markdown dump

常见问题Questions people actually ask

JSON 转 Markdown 会得到表格吗?Does JSON to Markdown give me a table?

不会。中间那步产出的是折叠树的 HTML(`div` / `span` / `details`),里面没有 `<table>`,所以 Markdown 里不会有管道表——只有逐行的键与值。要表格,请先把数据渲染成带 `<table>` 的 HTML(或从 Excel / CSV 出发),再转 Markdown。No. The middle step emits the collapsible tree as `div` / `span` / `details`, with no `<table>` in it, so the Markdown holds line-by-line keys and values rather than a pipe table. Render the data into HTML that actually contains a `<table>` (or start from Excel or CSV) when you want one.

为什么不干脆用代码块把 JSON 包起来?Why not just wrap the JSON in a code block?

因为这一条不是「包起来」:它走的是查看器渲染,所以得到的是给人读的行文(带 `Object(4)` 这类摘要),也失去了缩进与可逆性。想让 Markdown 里原样保留 JSON,最快的办法是把它写进围栏代码块再转,或直接把 `.json` 改名——那是另一种取舍,本条不假装两全。Because this route is not a wrapper: it renders the viewer, so you get human-readable lines with `Object(4)`-style summaries and lose both indentation and reversibility. To keep JSON verbatim in Markdown, put it in a fenced block yourself or rename the `.json` file — a different trade, which this page does not pretend to cover.

很深或者很大的 JSON 会怎么样?What about very deep or very large JSON?

序列化查看器那一步是显式栈的迭代实现,不是递归——递归版本在解析成功之后仍会把栈耗尽,把一次正常转换报成 `RangeError`。同时查看器自身有行数与长度的预算,触顶时会在界面里写明实际读了多少,不会拿半棵树冒充整个文档。The viewer serialisation is iterative over an explicit stack, not recursive — the recursive version used to exhaust the stack after a successful parse and reach the user as a `RangeError` from a conversion that had every right to finish. The viewer also works under line and length budgets, and when one is hit the interface says how much it actually read instead of passing a partial tree off as the document.

不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.