About JSON Formatter & Validator
This JSON formatter and validator turns a messy or minified JSON string into readable, indented text, or compresses it back into a single line. You can indent with 2 spaces, 4 spaces or a tab, and optionally sort all object keys from A to Z, which helps when comparing two files. The result is shown in a box you can copy or download.
When the input is not valid JSON, the validator reports the problem together with its line and column, such as a missing comma, single quotes or an unquoted key. The parser is strict, so comments and trailing commas are flagged as errors. Everything runs in your browser and your data is not uploaded. A green check confirms valid JSON.
How to use JSON Formatter & Validator
- 01
Paste your JSON.
- 02
Click Format, Minify or Validate.
- 03
Copy or download the result.
When to use it
- Reading a minified API response copied from the browser network tab or a log file.
- Finding the missing comma or quote that breaks a config file.
- Minifying JSON before pasting it into a request body or an environment variable.
- Sorting keys so two JSON files can be compared line by line in a diff.
- Checking that a payload is valid before sending it to a webhook.
Frequently asked questions
How do I find an error in my JSON?
Paste the text and click Validate. The message names the problem and shows the line and column where parsing stopped, for example a missing comma, a key without double quotes or an unexpected character after the end.
Why does my JSON fail with single quotes or comments?
Standard JSON only allows double-quoted strings and keys, and has no comments or trailing commas. This tool follows the standard strictly, so JavaScript-style objects with single quotes must be converted first.
Can I sort keys and change the indentation?
Yes. Choose 2 spaces, 4 spaces or a tab, tick the sort keys option to order every object alphabetically, then click Format. Minify ignores the indentation and produces a single compact line.
Is my JSON uploaded to a server?
No. Formatting, minifying and validation run in your browser with JavaScript, so the text stays on your device. There are no limits on use and no sign-up is needed.
Does formatting change my data?
The values are kept, but the text is re-serialized. Very large integers beyond JavaScript's safe range may lose precision, and duplicate keys in one object collapse to the last value. Check important numeric ids as strings if they are very large.
Can I download the result?
Yes. Besides copying the output, you can download it as a data.json file straight from the result box. The file contains exactly the formatted or minified text currently shown in the result box.