跳转到主要内容

JSON 查看器、格式化工具与编辑器

在实时交互树中查看、编辑和格式化 JSON。支持内联值编辑、键名重命名、添加/删除节点、JSONC 注释以及一键导出——全部在浏览器中完成。

Input
0 chars | 0 bytes
Supports JSON with comments (// and /* */)
Output
Paste JSON to see the tree view

Raw JSON from an API response or log file is often a single dense line — completely unreadable without formatting. A good JSON viewer instantly pretty-prints nested objects and arrays, highlights syntax, and collapses or expands nodes so you can navigate to exactly the key you care about without scrolling through thousands of characters.

This tool goes further by letting you edit the JSON in place. Fix a malformed value, rename a key, or delete an unwanted node, and the tree updates live. It's the fastest way to prototype configuration payloads, inspect webhook bodies, verify GraphQL responses, or clean up a JSON fixture before committing it to your test suite — all without spinning up a terminal or installing any extension.

如何在线格式化和查看 JSON

  1. 1

    粘贴您的 JSON

    将任意 JSON 字符串粘贴到输入面板中。验证立即运行,并以行号和字符位置高亮显示错误。

  2. 2

    浏览树形结构

    格式化后的 JSON 以语法高亮和可折叠树形结构呈现。点击折叠三角形可展开或收起嵌套对象和数组。

  3. 3

    复制或压缩

    复制美化输出,或切换到压缩模式以去除所有空白字符。

How JSON Parsing and Tree Rendering Works

JSON (JavaScript Object Notation) is defined by RFC 8259 as a strict subset of JavaScript literal syntax, supporting six value types: strings, numbers, booleans, null, arrays, and objects. The parser tokenises the input character by character, validating structural characters (`{`, `}`, `[`, `]`, `,`, `:`) and ensuring strings are properly quoted and escaped. Numbers must match a specific grammar — no leading zeros, no hex literals, no trailing commas.

The interactive tree renderer maps each parsed node to a collapsible DOM element. Depth-first traversal assigns each node a path (e.g. `$.users[2].email`) which powers features like copying a path to the clipboard or filtering by key name. Large arrays are virtualised — only visible rows are rendered — to keep the UI responsive even for JSON files with tens of thousands of entries.

为什么使用 FileCrank JSON 格式化工具?

  • ✓ 实时验证,精确显示错误的行号和字符位置。
  • ✓ 可折叠树形视图,轻松导航深度嵌套的 JSON。
  • ✓ 一个工具同时支持美化和压缩模式。
  • ✓ 实时生成 JSON 面板展示修改后的输出,随时可复制。
  • ✓ 完全在浏览器中运行——数据永远不会发送到任何服务器。
  • ✓ 完全在浏览器中运行——不向任何服务器发送数据。

功能与规格

最大文件大小
最大 100 MB
隐私
文件在约一小时后删除
价格
免费,无需注册
处理方式
100%客户端
验证
Real-time JSON syntax validation
剪贴板支持
One-click copy to clipboard
您的 JSON 数据永不离开浏览器——所有处理均在本地完成。无需注册账户。免费使用,无限制。

常见问题

美化和压缩有什么区别?

美化添加换行和缩进,使 JSON 易于人类阅读。压缩删除所有空白字符,生成尽可能小的 JSON 字符串。阅读和调试时使用美化,减少传输大小时使用压缩。

为什么验证器对看似正确的 JSON 报错?

常见原因:最后一项后有尾随逗号(JSON 不允许)、字符串使用单引号(JSON 要求双引号)、包含注释(JSON 没有注释语法)、字符串中有未转义的控制字符。

可以在树形视图中折叠和展开嵌套对象吗?

可以。点击折叠三角形可收起或展开任意节点。折叠的节点会显示元素数量,方便您定位,而无需展开全部内容。

可以直接在树形视图中编辑 JSON 值吗?

可以。点击任意值可就地编辑——工具会自动检测类型(字符串、数字、布尔值、null)。双击键名可重命名。使用 + 按钮添加新条目,× 按钮删除任意节点。

什么是 JSONC,如何使用?

JSONC 是带注释的 JSON,支持 // 单行注释和 /* */ 多行注释。直接粘贴 JSONC,工具会在解析前自动去除注释。适用于 tsconfig.json 或 VS Code 设置等配置文件。

JSON 输入有大小限制吗?

工具可处理达到显示输入限制的 JSON。超过 1 MB 的超大 JSON 也可解析和渲染,但树形视图导航可能较慢。

Browser JSON Viewer vs. jq vs. IDE Extensions

Command-line `jq` is unbeatable for scripted transformations and pipeline processing, but requires memorising its query syntax. IDE extensions add JSON support to your editor but are overkill when you just want to inspect a pasted response. A browser-based viewer requires zero setup, works on any device, and is the fastest option for quick inspection and one-off edits — especially when you are working with a payload you received in a chat message or email.

FileCrank JSON 格式化工具在浏览器中对 JSON 进行格式化、验证,并以语法高亮和可折叠树形视图显示。

Advertisement

Ad