Strange Tool工具箱

JSON FormatterJSON 格式化

Paste messy JSON and get it back clean: pretty-printed, validated and explorable as a tree. Everything runs locally in your browser — nothing is uploaded, ever. 粘贴 JSON 即可格式化、校验并以树形结构查看,全部在本地浏览器运行,不上传任何数据。

Waiting for input · 等待输入 Size 大小 0 B Keys 键 0 Max depth 最大深度 0 Objects 对象 0 Arrays 数组 0

Input 输入

Result 结果

Tree view树形视图

Click a row to copy its path · 点击任意一行复制路径
Parse valid JSON to explore it here. 输入有效 JSON 后可在此浏览结构。

How it works使用方法

  1. 1

    Paste your JSON粘贴

    Drop raw JSON into the input box — from an API response, a config file, a log line. Or hit “Load sample” to see it in action.

  2. 2

    Format, minify or validate处理

    Pretty-print with 2 spaces, 4 spaces or tabs; minify to a single line for production; or just validate. Broken JSON is pinpointed by line and column, with the faulty line highlighted.

  3. 3

    Explore and take it away浏览导出

    Walk the collapsible tree, click any node to copy its path (like $.tools[2].name), then copy the result or download it as a .json file.

FAQ常见问题

Is my JSON uploaded to a server?我的 JSON 会被上传吗?

No. Parsing, formatting and validation all happen in JavaScript inside your own browser tab. The page makes no network requests with your data, so API keys, tokens and private payloads stay on your machine. You can even disconnect from the internet after the page loads and it keeps working.

What does minify do?压缩是做什么的?

Minifying removes every unnecessary space, indent and line break, producing the smallest valid single-line version of the same JSON. The data is identical — only the whitespace goes. It is handy before embedding JSON in a request, a config value or a size-sensitive place.

How are errors located?错误是怎么定位的?

The parser reads your text character by character and stops at the first problem. You get the exact line and column, a plain-language explanation (a trailing comma, an unquoted key, a string missing its closing quote…), and the offending line is highlighted in the input box so you can fix it in seconds.

What do “Sort keys” and “Escape non-ASCII” do?键排序和转义选项有什么用?

“Sort keys” reorders every object’s keys alphabetically, which makes two JSON documents easy to compare or diff. “Escape non-ASCII” rewrites characters such as Chinese text or emoji as \uXXXX sequences, producing pure-ASCII output that is safe for older systems — the parsed data stays exactly the same.