Data tool
JSON Formatter and Validator
Paste JSON to format and beautify it, minify it to one line, or validate it and see exactly where it breaks.
Runs entirely in your browser. Nothing you paste is uploaded.
Paste some JSON to get started.
How to use the JSON Formatter
- Paste your JSON into the left box. It is checked as you type.
- Choose Format for readable, indented output or Minify for the smallest single-line version.
- Pick the indent size, optionally sort keys alphabetically, then copy or download the result.
What this JSON formatter and validator does
A JSON formatter, also called a JSON beautifier or JSON viewer, turns compact or messy JSON into indented text that is easy to read. A JSON validator checks that the text follows the JSON rules. This tool does both, and it can minify JSON again when you need the smallest file.
JSON breaks easily: one missing comma or an extra trailing one and the whole document is rejected. This tool parses your input with a strict JSON parser and reports the line and column of the first problem in plain words, such as a trailing comma, single quotes, or an unclosed bracket.
Formatting never changes your data. Numbers are kept exactly as written, so a value like 12345678901234567890 is not rounded the way it would be if it passed through JavaScript numbers, and string escapes are preserved.
Use Sort keys to put every object in alphabetical order, which makes two versions of the same file much easier to compare.
Common questions
How do I format JSON online?
Paste the JSON and choose Format. The formatter indents it and, if the JSON is invalid, shows the line and column of the error. Choose Minify to put it back on one line.
Can it validate JSON as well as format it?
Yes. Every paste is checked against the JSON rules first, so the formatter doubles as a JSON validator.
Is my JSON sent to a server?
No. Parsing and formatting happen in your browser with JavaScript. Nothing you paste leaves your device.
Why does it say my JSON is invalid when JavaScript accepts it?
JSON is stricter than JavaScript object syntax. Property names and strings need double quotes, trailing commas are not allowed, and comments are not part of JSON.
Will formatting change large numbers?
No. Numbers are copied through as text, so long integers and precise decimals come out exactly as they went in.
What is the difference between Format and Minify?
Format adds line breaks and indentation so people can read the data. Minify removes all optional whitespace so the file is as small as possible for transfer.
Guides for the JSON Formatter
- How to Format and Validate JSON Online (and Fix Common Errors)Format, minify and validate JSON online. See the five JSON errors that break files most often, how to find the exact line, and how to fix each one.
- What Is JSON? A Beginner's Guide with ExamplesWhat JSON is and how to read it: objects, arrays and the six value types, the syntax rules that trip people up, and where JSON is used on the web.
- JSON vs XML vs YAML: Differences and When to Use EachJSON vs XML vs YAML compared with the same data in each format: syntax, comments, data types, readability and the jobs each one is best suited for.
- How to Read a JSON API Response (Step by Step)How to read a JSON API response step by step: check the status, format the body, find the data, handle arrays, pagination and errors, with examples.