Formatting & conversion
Format, indent, or minify JSON online, in the browser.
1
Did you know? JSON was popularized by Douglas Crockford in the early 2000s. He describes it as a format he "discovered" rather than invented, since it was already part of JavaScript.
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. The tool does not upload the text. The site keeps your theme, favorites and cookie choice on this device, and it may load a visit counter or ads if you accept them. {"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.