Use this free JSON formatter and validator to turn messy JSON into clean, readable text, or to compress it into a single line. Paste your JSON, choose an indentation style, and click Format. If the JSON is invalid, the tool shows the error with its line and column so you can fix it quickly. You can copy the result or download it as a .json file.
Readable JSON is easier to debug, review, and share. Format it before you commit it, and minify it only when size matters.
How to use the JSON formatter
- Paste your JSON: drop in an API response, a config file, or any JSON text.
- Choose indentation: 2 spaces, 4 spaces, or tabs. Turn on key sorting if you want a stable order.
- Click Format or Minify: Format makes the JSON readable, and Minify removes all extra whitespace.
- Copy or download: copy the result to your clipboard or save it as a .json file.
What the tool does
| Action | Best for | What you get |
|---|---|---|
| Format | Reading and reviewing JSON | Indented JSON with one value per line |
| Minify | Smaller payloads and config files | A single line with no extra spaces |
| Validate | Finding syntax mistakes | A valid or invalid result with line and column |
| Sort keys | Comparing two JSON files | Object keys in A to Z order at every level |
Common JSON errors
- Trailing commas: JSON does not allow a comma after the last item in an object or array.
- Single quotes: keys and strings must use double quotes, not single quotes.
- Unquoted keys: every key must be a double-quoted string.
- Comments: standard JSON does not support // or /* */ comments.
- Missing brackets: every opening brace or bracket needs a matching closing one.
- Invalid values: use true, false, and null in lowercase. Values like undefined and NaN are not valid JSON.
Whether you are debugging an API response or tidying a config file, clean JSON saves time, and a quick validation catches mistakes before they ship.
Worked examples
Format an API response
Paste {"id":1,"tags":["a","b"],"active":true} and click Format with 2 spaces. Each key moves to its own line and the array is expanded, so the structure is easy to scan.
Minify a config file
Paste a formatted config and click Minify. The tool removes line breaks and indentation, and the summary shows how many characters you saved.
Find a syntax error
Paste JSON with a trailing comma, such as {"a":1,}. The tool reports the problem and points to the line and column where parsing failed.
Frequently asked questions
Is this JSON formatter free to use?
Yes. You can format, minify, validate, copy, and download JSON without creating an account.
Is my JSON uploaded or stored?
No. All processing happens in your browser. Nothing you paste is sent to a server or saved, and clearing the form removes it from the screen.
Does it validate JSON?
Yes. Formatting and minifying both parse the JSON first, so invalid input shows an error message with a line and column when the browser provides one.
Does sorting keys change my data?
It changes only the order of keys inside objects. Values and array order stay the same, and JSON objects are unordered by definition.
Why did my large numbers change?
Browsers read JSON numbers as standard floating-point values, so integers beyond 9,007,199,254,740,991 can lose precision. Store very large IDs as strings to keep them exact.
Can it handle JSON with comments?
No. Standard JSON does not allow comments, so remove them first. Files such as JSONC or JSON5 need to be converted to plain JSON.