压缩 JSON

去掉源代码中多余的排版空白,输出仍是文本而非压缩文件。

输入: 文本结果: 文本

文本输入

运行后查看结果

案例

A support ticket with a zero-prefixed identifier

输入

{
    "ticket": "00123",
    "priority": "high"
}

Expected answer

{"ticket":"00123","priority":"high"}
An observatory reading with a negative temperature

输入

{
    "station": "demo-observatory",
    "temperatureC": -12.5,
    "open": false
}

Expected answer

{"station":"demo-observatory","temperatureC":-12.5,"open":false}
A café menu with Unicode and a decimal price

输入

{
    "item": "café",
    "price": 3.5,
    "currency": "EUR"
}

Expected answer

{"item":"café","price":3.5,"currency":"EUR"}
A safe webhook retry policy

输入

{
    "timeoutMs": 5000,
    "retries": 2,
    "enabled": true
}

Expected answer

{"timeoutMs":5000,"retries":2,"enabled":true}
An image manifest with a null caption

输入

{
    "width": 640,
    "height": 480,
    "caption": null
}

Expected answer

{"width":640,"height":480,"caption":null}
A release note with an embedded newline

输入

{
    "version": "2.1.0",
    "notes": "Fixed parser\nAdded tests"
}

Expected answer

{"version":"2.1.0","notes":"Fixed parser\nAdded tests"}
An empty search result

输入

{
    "results": [],
    "total": 0
}

Expected answer

{"results":[],"total":0}
Minify a 64-bit identifier without rounding

输入

{"id": 18446744073709551615, "active": true}

Expected answer

{"id":18446744073709551615,"active":true}
boolean

输入

false

Expected answer

JSON
false
emptyList

输入

[
 
  	]

Expected answer

JSON
[]

相关工具

代码整理

操作参考

查看原始技术文档 (English)