Web Toolkit

JSON Formatter

Format, validate and minify JSON with precise error positions.

JSON

Input0 chars
Output

Formatted JSON appears here.

Private by design. Everything runs locally in your browser. Your input is never uploaded, logged or stored on a server.

How to use the JSON Formatter

  1. Paste the JSON into the input panel — an API response, a config file or a single object.
  2. Press Beautify to indent it, or Minify to strip every space back out.
  3. Set the indent size, and turn on Sort keys when two responses have to line up for a diff.
  4. Copy the result, or download it as a file.

A worked example

Input
{"b": 2, "a": [1, 2],}
Output
Unexpected token } in JSON at position 21

The trailing comma after the array is valid JavaScript and invalid JSON. The reported position points at the }; the mistake is always the character before it.

Frequently asked questions

What is a JSON formatter?

It re-indents JSON so nested objects and arrays line up, making the structure readable. This tool also parses the input, so invalid JSON is rejected with the exact position of the problem instead of a generic error.

Is this JSON formatter free?

Yes. There is no signup, no usage limit and no paid tier for this tool.

Does this tool upload my JSON?

No. Formatting happens with the browser built-in JSON parser on your own machine. Nothing is sent over the network, so it is safe for payloads that contain internal data.

Why does my JSON fail to parse?

The four most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted object keys, and a raw newline inside a string. The error message points at the first character the parser could not accept.

How large a document can it handle?

Documents up to a few megabytes format instantly. Very large files are limited by your browser memory rather than by the tool.

About the JSON Formatter

A JSON formatter turns a single unreadable line of JSON into an indented, scannable document. This one also validates: when the parser fails it reports the line and column where it gave up, which is usually a trailing comma, a single quote where a double quote belongs, or an unescaped control character.

Sort keys alphabetically when you need to diff two API responses that return object keys in a different order, and minify before pasting a payload into an environment variable or a URL.

What it does not do

  • It reports where the parser stopped. It does not guess at a repair and rewrite your document.
  • JSON5 and JSONC — comments, trailing commas, unquoted keys — are rejected, because they are not JSON.
  • Document size is bounded by your browser memory, not by a server limit.

Further reading

Related tools