JSON Formatter and Validator
Format, validate, minify and copy JSON online. Errors are shown with their position.
About this JSON formatter
JSON is the most common format for sending data between web apps and APIs, but raw JSON is often squashed onto one line and hard to read. This tool pretty-prints it with clean indentation, checks that it is valid, and can also minify it back into a compact form.
How to use it
- Paste your JSON into the box.
- Choose an indent size.
- Press Format to beautify it, or Minify to remove all extra whitespace.
- If the JSON is invalid you will see an error message with the position of the problem.
- Copy the result or download it as a .json file.
What it checks
Validation follows the standard JSON rules your browser uses. Keys must be in double quotes, strings use double quotes, there are no trailing commas, and comments are not allowed. Single-quoted strings, unquoted keys and JavaScript-style comments will be reported as errors.
Common uses
- Reading API responses while debugging.
- Checking a config file before deploying.
- Shrinking JSON before embedding it in a request.
- Finding the exact spot of a missing comma or bracket.
Limits and privacy
Everything runs in your browser and nothing you paste is uploaded. Very large files, many megabytes in size, may slow down or freeze a phone browser. Numbers beyond JavaScript’s safe integer range may lose precision when re-printed, so check large IDs carefully.
Frequently asked questions
Why does my JSON show an error?
The most common causes are a trailing comma, single quotes instead of double quotes, an unquoted key, or a missing bracket. The message shows where parsing stopped, which is usually right after the real mistake.
What is the difference between format and minify?
Format adds line breaks and indentation so people can read it. Minify removes all optional whitespace so the data takes less space.
Is my data sent to a server?
No. Parsing and formatting happen locally in your browser.
Does formatting change my data?
The values and key order stay the same. Only whitespace changes, apart from the large number precision caveat mentioned above.