JSON formatter, validator & minifier

Beautify, minify and validate JSON. Sort keys and keep numbers exact.

Enable JavaScript to use this interactive tool. Paste input, choose options, then copy or download the result, or save it to your notebook.

Example and common questions

Clean up an API response, compact a JSON payload, or check a configuration before using it. Processing stays in your browser. Original input is kept beside the output.

How to format, minify or validate JSON

  1. Paste JSON or use Choose files to open one UTF-8 .json or .txt file.
  2. Set indentation for formatting and optionally sort object keys for formatting or minification. Click Format JSON, Minify JSON or Validate JSON to run it immediately.
  3. Review validation and duplicate-key messages, then copy, download or save the complete result to your notebook.

Pretty-print a JSON response

JSON action
format
Indentation
2
Object key order
original
Input
{"hello":"world","count":2}
Formatted JSON
{
  "hello": "world",
  "count": 2
}
Are large numbers and duplicate keys preserved?

Yes. Formatting and minification preserve exact number tokens, string escapes, array order and every object entry. Duplicate keys are reported, including equivalent escaped key names. Sorting uses decoded key names, is case-sensitive, and preserves the order of duplicate entries.

Can I use comments or trailing commas?

This tool validates strict JSON. Comments, trailing commas and single-quoted strings report an error with a line and column. Your input is kept so you can correct it.

What does Validate change?

Nothing. It checks syntax and supported limits, reports duplicate keys, and shows your original JSON unchanged. You can copy, download or save that validated source.

Common errors and limitations

Use double-quoted property names and strings. Comments and trailing commas are not JSON. Input supports 500,000 UTF-16 characters, 100 nesting levels and 100,000 values. Output supports 2,000,000 characters; try Minify if indentation exceeds that limit. Files must be UTF-8, at most 2,000,000 bytes, and within the character limit. Only the first 20,000 output characters are displayed; exports contain the full result.