JSON Formatter & Validator

Format, minify and validate JSON, with the line and column of the first error.

Runs in your browser. Nothing you enter is sent to our servers.

Paste JSON below, then choose Format or Minify.

Checked as you type. Press Ctrl or ⌘ + Enter to format.

How to use this tool

Paste JSON into the input box, then choose Format to indent it or Minify to remove all optional whitespace. If the JSON is invalid, the tool shows what went wrong and where.

Use the indent menu to switch between two spaces, four spaces and tabs.

Questions and answers

Why is my JSON invalid?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, property names without quotes, and comments. None of these are allowed by the JSON standard (RFC 8259), even though JavaScript accepts some of them.

Is my data sent to a server?

No. Parsing and formatting use your browser’s built-in JSON engine. Nothing you paste is transmitted or stored.

Will formatting change my data?

No. The tool only rearranges whitespace. It does not convert your JSON into JavaScript values and back, so very large numbers keep every digit, object keys stay in their original order and escaped characters are left as you wrote them.

What is the difference between formatting and minifying?

Formatting adds line breaks and indentation so people can read the structure. Minifying removes them so the file is as small as possible for transfer. The data is the same either way.