★LocalHost Run Under Construction
  • 首页
  • 文章
  • 工具
http://localhost
首页文章工具
全部工具›JSON 工具›美化 JSON

美化 JSON

使用适当的缩进和间距来格式化 JSON。

输入 JSON

Loading...

美化 JSON

​

工具选项

缩进

使用空格

​

使用空格缩进输出

使用标签

使用制表符缩进输出。

美化 JSON

此工具允许您使用适当的缩进和间距格式化 JSON 数据,使其更具可读性且更易于使用。


美化 JSON 示例

点击尝试!

Beautify an Ugly JSON Array

In this example, we prettify an ugly JSON array. The input data is a one-dimensional array of numbers [1,2,3] but they are all over the place. This array gets cleaned up and transformed into a more readable format where each element is on a new line with an appropriate indentation using four spaces.

​
​

缩进

使用空格

​

使用空格缩进输出

使用标签

使用制表符缩进输出。

Prettify a Complex JSON Object

In this example, we prettify a complex JSON data structure consisting of arrays and objects. The input data is a minified JSON object with multiple data structure depth levels. To make it neat and readable, we add two spaces for indentation to each depth level, making the JSON structure clear and easy to understand.

​
​

缩进

使用空格

​

使用空格缩进输出

使用标签

使用制表符缩进输出。

Beautify a JSON with Excessive Whitespace

In this example, we show how the JSON prettify tool can handle code with excessive whitespace. The input file has many leading and trailing spaces as well as spaces within the objects. The excessive whitespace makes the file bulky and hard to read and leads to a bad impression of the programmer who wrote it. The program removes all these unnecessary spaces and creates a proper data hierarchy that's easy to work with by adding indentation via tabs.

​
​

缩进

使用空格

​

使用空格缩进输出

使用标签

使用制表符缩进输出。


全部 JSON 工具


  • 验证 JSON — 验证 JSON 代码是否存在错误
  • 最小化 JSON — 通过删除空格来缩小 JSON
  • 字符串化 JSON — 将对象转换为 JSON 字符串
  • JSON 到 XML — 将 JSON 转换为 XML 格式
  • JSON 转 CSV — 将 JSON 转换为 CSV 格式
  • 转义 JSON — 转义 JSON 中的特殊字符
  • 比较 JSON — 查找两个 JSON 对象之间的差异
  • JSON 排序 — 按值或键对 JSON 数组/对象排序

LocalHost Run · 联系我们 · 隐私政策 · 使用条款

© 2026 LocalHost Run · localhost 指南、文章与开发者工具 · localhostrun.com
访客计数: 1025Best viewed in Netscape Navigator · 800×600© LocalHost Run