Tools

JSON formatter

Pretty-print, minify, and validate JSON in your browser. Paste a payload or open a file. Nothing is uploaded.

Paste JSON, then Format or Minify.

How to format JSON online

  1. Paste JSON into the box, or open a .json file.
  2. Click Format to pretty-print, or Minify for a single line. Turn on Sort keys if you want stable diffs.
  3. Copy the result into your editor, ticket, or API client.

Pretty-print vs minify

Pretty-print (also called JSON beautify) adds indentation and line breaks so nested objects and arrays are readable. Use two spaces, four spaces, or tabs. Minify strips that whitespace. The data is the same; only the layout changes. Minified JSON is what most APIs send and what you want when a field, log line, or environment variable has to stay on one line.

Validate JSON as you format

This formatter parses with the same rules as JSON.parse. If the text is not strict JSON, formatting stops and the error points at the first problem. Trailing commas, single quotes, comments, and unquoted keys are JavaScript object literals, not JSON. An API that returns those will fail here for the same reason it fails in production.

Sort keys for reviews and diffs

Two payloads can be equal and still look different because key order changed. Sort keys rewrites every object with keys in alphabetical order, including nested objects, so a pull request or log comparison is about values, not shuffle.

Nothing is uploaded

Formatting runs in this tab. Your JSON is not posted to Geek University, stored in a database, or sent to a third-party formatter API. Typical request bodies and config files up to 1.5 MB are supported.

Need a spreadsheet instead? Convert with JSON to CSV. Trailing commas or comments? Use the JSON fixer. More utilities live on tools, or see the Python course if you are learning to parse JSON in code.

JSON formatter FAQ

Does this JSON formatter upload my data?

No. Formatting runs in your browser with JSON.parse and JSON.stringify. The JSON never leaves your machine.

What is the difference between pretty-print and minify?

Pretty-print adds indentation and line breaks so you can read nested objects. Minify strips that whitespace so the payload is smaller for APIs, logs, and copy-paste into one-line fields.

Why does my JSON fail to format?

Strict JSON rejects trailing commas, single quotes, comments, and unquoted keys. Those are JavaScript object literals, not JSON. Repair them with the JSON fixer, then format again.

Can I sort JSON keys?

Yes. Turn on Sort keys, then Format. Nested objects are sorted recursively so diffs and reviews stay stable.

Is this JSON formatter free?

Yes. There is no account. Typical API bodies and config files up to 1.5 MB are supported.