JSON Formatter

Format, validate, and minify JSON — instantly, in your browser.

Updated

Paste messy or minified JSON and instantly get it beautifully formatted and validated — or minify it to shrink the payload. Everything runs locally in your browser, so your data never leaves your device.

Runs entirely in your browser — nothing is uploaded.

What does a JSON formatter do, and why does my JSON fail to validate?

A JSON formatter takes raw JSON, checks that it is valid, and rewrites it either pretty-printed with indentation for reading or minified onto one line for transfer. This tool uses your browser's built-in parser, the same one every JavaScript program relies on, so validation is strict standard JSON: keys must be double-quoted, strings use double quotes, and comments, trailing commas, and single quotes are all rejected. Format indents with two spaces and preserves key order exactly as written; Minify strips every unnecessary space and line break for the smallest possible payload. When parsing fails, the parser's own error message is shown so you can see what it choked on, though the exact wording varies by browser. Everything happens on your device the moment you click Format or Minify, and nothing is uploaded, so it is safe for API responses that contain credentials or personal data. A Copy button puts the result on your clipboard.

How to use the json formatter

  1. 1Paste your JSON into the input box.
  2. 2Click Format to pretty-print it, or Minify to compact it.
  3. 3Copy the result — invalid JSON is flagged with the exact error.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting and validation happen entirely in your browser — nothing is sent to a server.

What does minify do?

Minifying removes all whitespace and line breaks to produce the smallest valid JSON, useful for reducing payload size.

Why is my JSON invalid?

The tool shows the parser's exact error, commonly caused by trailing commas, single quotes, or unquoted keys.

Can I change the indent size or sort keys?

Not currently. Format always indents with two spaces, which is the most common convention, and keeps keys in the order they were written. Minify removes all whitespace. If you need tabs or four-space indentation, format here first and re-indent in your editor.

Read the guide
How to Format & Fix JSON (Common Errors)

Related tools