JSON Formatter & Validator

How to use 3 steps
  1. Paste your data under Paste Raw JSON Data.
  2. Press Format, Beautify or Minify; invalid JSON is reported instead.
  3. Press Copy Output.

Read the full guide

Formatted JSON Output

Loading the tool… 0 of 3 parts

Getting the tool ready. On a slow connection this can take a few seconds.

How this tool works

The text is parsed with the browser's own JSON parser, which is the same one your code will use, so anything accepted here will be accepted there. Beautifying re-prints the parsed data with two-space indentation; minifying re-prints it with no whitespace at all. Both produce the same data, and both report the root type, the key or item count, and the byte size.

When parsing fails, the message is turned into a line and column rather than a character offset, because an offset in a 40,000-character payload tells you nothing. It is strict JSON throughout: comments, trailing commas, single quotes and unquoted keys are all rejected, exactly as they would be by an API.

Reading the result honestly

  • The output is a re-print, not your text: the data is parsed and written out again, so whitespace, line breaks and formatting choices are replaced rather than tidied.
  • Duplicate keys silently collapse: JSON allows them and the parser keeps the last one. If a payload had two keys of the same name, only one survives the round trip and nothing warns you.
  • Very large integers lose precision: anything beyond about sixteen digits is rounded, because numbers are parsed as doubles. Identifiers of that size belong in strings.
  • Numeric-looking keys are reordered: a key such as "2" is moved ahead of ordinary text keys when the object is written out. The data is identical; the order is not what you pasted.

Full guide

2 min read

Why a duplicate key in your JSON vanishes without any warning

The parser keeps only the last occurrence and says nothing about the ones it dropped. Why keys that look like numbers get silently reordered ahead of text keys, and why very large integers lose precision on the way through.

Read the guide

Frequently Asked Questions

Specific to the JSON Formatter & Validator. Broader questions about this category are answered on the category page.

Beautifying adds indentation and line breaks so a person can read the structure; minifying removes every unnecessary character so a machine can transfer it faster. The data is identical either way.
Almost always a trailing comma after the last element, single quotes instead of double, an unquoted key, or an invisible character pasted from a rich-text editor. The line and column point at the token that broke it.
No. JSON has no comment syntax, however common it is in configuration files. If a file needs comments it is JSON5 or JSONC, which this deliberately does not accept, because your parser will not either.
Keys that look like non-negative integers are ordered first by the language itself, ahead of every other key. Everything else keeps the order it was written in. Nothing is lost, but the sequence may differ.
No. Parsing happens in browser memory and nothing is transmitted or stored, which is what makes it safe to paste an API response containing credentials or personal data.

Subscribe to receive notifications about new tools, features, and productivity tips.