How to use
Use this tool to format or compress JSON safely.
- Paste your JSON into the input.
- Choose indentation and (optional) key sorting.
- Click Format or Minify.
- Use Validate to check for errors without changing the output.
- Click Copy Output to copy the result.
FAQ
Does this JSON formatter upload my data?
No. Formatting and validation run locally in your browser.
What’s the difference between Format and Minify?
Format adds whitespace and newlines for readability; Minify removes them to produce compact JSON.
Can it fix invalid JSON automatically?
No—this tool is strict. It will show an error so you can fix issues like trailing commas or missing quotes.
What does “Sort keys” do?
It alphabetically sorts object keys (and nested object keys). Array item order is not changed.
Why do comments or trailing commas fail?
Because they are not valid in standard JSON. Remove comments and trailing commas before formatting.
Can I format a JSON string that contains JSON?
Yes—enable “If input is a JSON string, parse it” to decode double-encoded JSON.
Is there a size limit?
It depends on your device and browser memory. For very large JSON, try minifying or formatting in smaller chunks.