Skip to content

Data tool

JSON Formatter and Validator

Paste JSON to format and beautify it, minify it to one line, or validate it and see exactly where it breaks.

Runs entirely in your browser. Nothing you paste is uploaded.

Paste some JSON to get started.

JSON Formatter by YegappanFree tool. Open the full page for the guide.

How to use the JSON Formatter

  1. Paste your JSON into the left box. It is checked as you type.
  2. Choose Format for readable, indented output or Minify for the smallest single-line version.
  3. Pick the indent size, optionally sort keys alphabetically, then copy or download the result.

What this JSON formatter and validator does

A JSON formatter, also called a JSON beautifier or JSON viewer, turns compact or messy JSON into indented text that is easy to read. A JSON validator checks that the text follows the JSON rules. This tool does both, and it can minify JSON again when you need the smallest file.

JSON breaks easily: one missing comma or an extra trailing one and the whole document is rejected. This tool parses your input with a strict JSON parser and reports the line and column of the first problem in plain words, such as a trailing comma, single quotes, or an unclosed bracket.

Formatting never changes your data. Numbers are kept exactly as written, so a value like 12345678901234567890 is not rounded the way it would be if it passed through JavaScript numbers, and string escapes are preserved.

Use Sort keys to put every object in alphabetical order, which makes two versions of the same file much easier to compare.

Common questions

How do I format JSON online?

Paste the JSON and choose Format. The formatter indents it and, if the JSON is invalid, shows the line and column of the error. Choose Minify to put it back on one line.

Can it validate JSON as well as format it?

Yes. Every paste is checked against the JSON rules first, so the formatter doubles as a JSON validator.

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser with JavaScript. Nothing you paste leaves your device.

Why does it say my JSON is invalid when JavaScript accepts it?

JSON is stricter than JavaScript object syntax. Property names and strings need double quotes, trailing commas are not allowed, and comments are not part of JSON.

Will formatting change large numbers?

No. Numbers are copied through as text, so long integers and precise decimals come out exactly as they went in.

What is the difference between Format and Minify?

Format adds line breaks and indentation so people can read the data. Minify removes all optional whitespace so the file is as small as possible for transfer.

Guides for the JSON Formatter

Related tools