JSON Formatter

Pretty-print, minify, validate & sort-key JSON.

A free JSON formatter / validator / minifier that pretty-prints with 2-space, 4-space or tab indent, minifies to a single line, and can optionally sort object keys alphabetically. Parse errors are shown with a message, and everything runs locally — your data is never uploaded.

How to use

  1. Paste your JSON into the input box on the left.
  2. Choose an indent (2 / 4 / Tab) or pick Minify for single-line JSON.
  3. Turn on Sort keys when you want a stable, diff-friendly order.
  4. Copy the result on the right; invalid JSON shows an error instead of garbage.

FAQ

Is my JSON uploaded?
No. Parsing and formatting run in your browser; the content never leaves your device.
What does “Sort keys” do?
It recursively reorders every object’s keys alphabetically, which makes it easier to compare two JSON documents or produce stable version-control diffs. Array order is preserved.
Why am I getting a parse error?
It means the input is not valid JSON — common causes are trailing commas, single quotes, unquoted keys or comments. The tool shows the engine’s error message (often with a position) to help you locate it.

Related tools