JSON Formatter and Validator
Paste JSON to check it and lay it out with 2 or 4 spaces or tabs, or squeeze it onto one line. If it is not valid, you get the line and column of the problem and a hint about the usual mistakes. Numbers and text are kept exactly as written, so a long id never loses a digit.
Valid JSON
3 objects, 1 array, 8 keys, up to 3 levels deep · 113 → 185 characters
How it works
- Paste or type your JSON.
- Choose the indentation, or Minify, and tick Sort keys if you want them in alphabetical order.
- If there is an error, go to the line and column shown.
- Copy the result or download it as a file.
What people use it for
Reading an API response
Turn a single long line into an indented tree you can follow.
Fixing a config file
Find the missing comma or quote with an exact line and column.
Comparing two files
Sort the keys of both so a text diff shows only real differences.
Questions
- Why does it keep my long numbers intact?
- Many formatters read the numbers into the browser's floating-point type, which turns 12345678901234567890 into 12345678901234567000. This tool reads the text itself and writes every number back exactly as you typed it.
- What counts as valid JSON?
- The strict format of RFC 8259: double-quoted keys and strings, no trailing commas, no comments, no single quotes, and the values true, false and null in lower case. A single value such as 42 is valid on its own. Nesting is limited to 400 levels.
- What happens to duplicate keys?
- They are kept as written, since the standard allows them, and the page tells you how many there are. Most programs keep only the last one, so duplicates are usually a mistake.
- Is my JSON uploaded?
- No. It is processed in your browser and not stored. It can handle up to 1,000,000 characters.