JSON Formatter & Validator
Format, minify and validate JSON in your browser. Pinpoint errors by line and column, and explore your data in a searchable tree view.
Runs in your browser. Nothing is uploaded.
About the JSON Formatter & Validator
JSON (JavaScript Object Notation) is the plain-text format most web APIs, configuration files and log pipelines use to exchange data. It is easy for programs to read, but a single response often arrives as one long line, and a missing comma or quote is hard to spot by eye.
A formatter adds consistent indentation and line breaks so you can read the structure, check that a field is where you expect it, and compare two payloads. Validation tells you exactly where the syntax breaks, and minifying does the reverse, removing whitespace to keep requests and stored documents small. The tree view helps with deeply nested data, such as API responses with arrays of objects, where you want to find one value without scrolling through hundreds of lines.
How to use the JSON Formatter & Validator
- 1
Paste your JSON into the input panel, open a .json file, or load the sample. Pasting, opening a file or loading the sample runs it automatically.
- 2
Choose an indent size and whether keys should be sorted alphabetically.
- 3
Press Format to pretty-print, Minify to remove whitespace, or Validate to check syntax only.
- 4
If the JSON is invalid, the status bar shows the error with its line and column. Use “Go to error” to jump to it.
- 5
Switch the output to Tree to browse nested data: expand or collapse nodes, search keys and values, and copy any node’s path or value.
- 6
Copy the result or download it as a .json file.
Examples
{"user":{"id":7,"tags":["a","b"]}}{
"user": {
"id": 7,
"tags": [
"a",
"b"
]
}
}{
"a": 1,
"b": 2,
}Error on line 4: a property name was expected after the comma. JSON does not allow trailing commas.Good to know
- Strict JSON only: comments, trailing commas, single quotes and unquoted keys are reported as errors (they are valid in JavaScript, not JSON).
- Numbers larger than 2^53 lose precision when formatted, because browsers parse JSON numbers as 64-bit floats.
- Very large files (tens of megabytes) may take a few seconds on slower devices.
Frequently asked questions
What is the difference between Format and Minify?
Format adds line breaks and indentation so JSON is easy to read. Minify removes all optional whitespace to make the payload as small as possible, which is useful for APIs and storage.
Does Validate change my JSON?
No. Validate only checks the syntax and reports the first error it finds. Your input and output stay as they are.
Why is my JSON invalid when it works in JavaScript?
JSON is stricter than JavaScript object syntax. Keys and strings must use double quotes, and comments and trailing commas are not allowed.
How do I explore large or deeply nested JSON?
Format your JSON, then switch the output panel to Tree. Expand only the parts you need, search for a key or value and jump between matches, and copy the JSONPath (for example $.items[0].id) of any node.
Is my code uploaded to a server?
No. Processing happens entirely in your browser, in a background thread. Your input is never sent to our servers or stored anywhere.
Related tools
More tools that pair well with this one.