Format, indent, or minify JSON online. 100 % local processing in your browser: no data is sent to a server.
1
JSON (JavaScript Object Notation) is a lightweight text format used to exchange structured data. It is the default format of most web APIs, and is widely used for configuration files, logs and NoSQL databases.
This tool turns compact or poorly indented JSON into a readable document (Format), or does the opposite by removing all unnecessary whitespace (Minify). It also validates the syntax: if the input is not valid JSON, the parser error is displayed.
package.json or tsconfig.json ). JSON.parse and JSON.stringify functions. Nothing is sent to a server, so the tool can be used with confidential data. {"name":"DTK","tools":[{"id":1,"label":"JSON Formatter"}],"active":true}{
"name": "DTK",
"tools": [
{
"id": 1,
"label": "JSON Formatter"
}
],
"active": true
}{
"user": {
"id": 42,
"roles": ["admin", "editor"]
}
}{"user":{"id":42,"roles":["admin","editor"]}}Formatting and minifying only add or remove whitespace between tokens. Spaces inside strings are always preserved, and the data itself is not modified.
JSON is stricter than JavaScript object syntax. The following mistakes are the most frequent causes of a parsing error.
{"a": 1, "b": 2,}{"a": 1, "b": 2}{name: 'DTK'}{"name": "DTK"}{
// Enables debug mode
"debug": true
}{
"debug": true
}{"value": undefined, "ratio": NaN}{"value": null, "ratio": null}1.0 becomes 1 and 1e3 becomes 1000 . 9007199254740991 (2^53 − 1) lose precision, because JavaScript stores numbers as 64-bit floating-point values. Large identifiers should be transmitted as strings. \u00e9 are decoded and displayed as the corresponding character ( é ). {"id": 12345678901234567890}
→ {"id": 12345678901234567000}json.tool . The best choice is the one already used by your project.