JSON Formatter and Validator
Paste JSON to check it, format it for reading, or minify it for sending. Errors show the line and column.
What this tool does
- Validates your JSON as you type and reports the line and column of the first error.
- Formats with 2 spaces, 4 spaces or tabs, so nested data is easy to read.
- Minifies by removing all extra whitespace, which makes the JSON shorter to send.
- Sorts keys alphabetically at every level, which helps when comparing two JSON documents.
Good to know
- Standard JSON does not allow comments or trailing commas, so those are reported as errors.
- Numbers larger than 9,007,199,254,740,991 can lose precision, because browsers read JSON numbers as floating point values.
Privacy
Your JSON is processed in your browser and is not uploaded.
Frequently asked questions
Why does my JSON show an error?
Standard JSON needs double quotes around keys and strings, and it does not allow comments or trailing commas. The message shows where the problem was found when your browser provides a position.
What is the difference between Format and Minify?
Format adds line breaks and indentation so people can read it. Minify removes all extra whitespace to make it shorter.
What does Sort keys do?
It sorts the keys of every object from A to Z, at every level. The order of items in arrays is not changed.
Can large numbers lose precision?
Yes. Browsers read JSON numbers as floating point values, so numbers beyond 9,007,199,254,740,991 can lose digits. Keep such values as strings.