JSON Formatter screenshot

JSON Formatter

Validate, beautify, or minify JSON strings instantly.

Privacy First
0 Runs
Updated 2026-11-06
Runs in your browser
Nothing uploaded
No account needed

Validate, beautify, or minify JSON strings instantly. Enter your numbers and get an instant result.

Paste JSON and this page tells you whether it parses, then rewrites it with two-space, four-space or tab indentation, or compresses it onto one line. The formatted text can be copied or downloaded as a .json file.

It validates syntax, not meaning. A document that parses can still be the wrong shape for the API you are about to call, and JSON has no comments, so a commented draft is rejected outright.

Everything runs in the tab with the browser's own JSON parser. Nothing is uploaded, there is no size quota from a server, and the page does not store what you paste.

How the validation and the rewrite work

Validation runs as you type: the text is handed to JSON.parse, and the result is either a green "Syntactically correct structure" or the parser's own error message with its position.

Beautify parses the document and re-serializes it with your chosen indent, so key order is preserved as written and whitespace inside strings is untouched. Minify does the same parse and emits the shortest legal form.

  • Beautify accepts 2 spaces, 4 spaces or a tab
  • Minify removes every optional space, newline and indent
  • Copy puts the output on the clipboard; Download saves it as formatted-json.json

What a green tick does not mean

A parse only proves the brackets, quotes and commas agree. Duplicate keys are accepted and the last one wins, so two settings with the same name silently become one.

Numbers keep their written form as far as the browser's double-precision value allows. An identifier longer than 15 or 16 digits can come back changed, which matters for account and order numbers.

Trailing commas and comments are not JSON, whatever a JavaScript file allows. If the document is really a JavaScript object literal, the parser will point at the first thing it cannot read.

How to use the indent buttons

Paste the document into the Raw JSON pane; validation runs as you type, either a green Syntactically correct structure or the parser's own message with its position. Pick 2 Spaces, 4 Spaces or Tab Indent, then Beautify Format for the indented document or Minify and Compress for the one-line form.

Copy puts the output on the clipboard and Download saves it. A parse proves brackets, quotes and commas agree, nothing more: duplicate keys collapse to the last one, integers past 15 or 16 digits can change value, and trailing commas and comments are rejected outright.

What to Expect

Best for

  • Checking that a payload parses before you send it
  • Reading a minified API response as an indented document
  • Producing a compact body for a request or a fixture

Not ideal for

  • JSON Lines or NDJSON, where each line is a separate document
  • Documents with comments or trailing commas
  • Editing a JSON document as a tree of fields rather than as text

What this tool keeps

  • Key order as written, because the rewrite re-serializes the parsed object
  • String contents byte for byte, including escapes and non-ASCII text
  • The numbers the browser can represent exactly

What may need cleanup

  • Integers beyond double precision, which can change value on a round trip
  • Duplicate keys, which collapse to the last one without a warning
  • A downloaded file named formatted-json.json, which you may want to rename

Common errors

  • A trailing comma after the last item
  • Single quotes around a key or a string
  • A comment, which JSON does not allow anywhere

Example use cases

  • Formatting a webhook body before filing a bug report
  • Checking a config file after a hand edit
  • Minifying a fixture so it fits in one line of a test

Sample input

Paste {"name":"AllTools","tags":["dev","utilities"]} and choose the two-space indent.

Sample output

The same document with one key per line, two-space indentation, and a green Valid JSON notice.

Who this is for

  • Developers reading or writing an API payload
  • Analysts inspecting an exported response
  • Anyone who needs to prove a document parses before sending it

Frequently asked questions

Does a green tick mean the JSON is valid for my API?

No. It proves the brackets, quotes and commas agree; duplicate keys collapse to the last one and very long integers can lose precision, so check the shape before you send it.

Can it read JSON Lines, comments or trailing commas?

No. Each line of JSON Lines is a separate document, and comments and trailing commas are not JSON, so the parser reports where it stopped.

What happens to key order when I beautify?

Beautify re-serializes the parsed object, so key order is kept as written and string contents are untouched apart from the chosen indentation.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.