JSON Formatter and Validator

Paste JSON to check it is valid and format it for reading.

Loading tool…

  • Free
  • No sign-up
  • Runs in your browser

How to use the json formatter

  1. Paste your JSON into the top box.
  2. Choose Format to make it readable or Minify to make it compact.
  3. If the JSON is invalid, the message tells you the line and column of the problem.
  4. Copy or download the result.

Common JSON errors and how to fix them

ProblemWrongRight
Trailing comma{"a": 1,}{"a": 1}
Single quotes{'a': 'b'}{"a": "b"}
Unquoted key{a: 1}{"a": 1}
Comment{"a": 1} // noteComments are not allowed
Python-style valuesTrue, Nonetrue, null
Missing comma{"a": 1 "b": 2}{"a": 1, "b": 2}

Format vs minify

Formatting adds line breaks and indentation so the structure is visible. Use it when reading or debugging an API response or config file. Minifying removes all optional whitespace to make the data as small as possible for sending over a network. Both contain exactly the same data.

Sort keys A to Z reorders the properties of every object alphabetically. It makes two JSON documents much easier to compare in a diff tool.

Private by design

API responses and config files often contain keys, tokens and personal data. This formatter runs entirely in your browser, and nothing you paste is sent to a server.

Frequently asked questions

What is JSON?

JavaScript Object Notation, a text format for structured data made of objects {}, arrays [], strings, numbers, true, false and null. It is the standard format for web APIs.

Can JSON have comments?

No. Standard JSON does not allow comments. Some tools accept JSON5 or JSONC, which do.

Is my text stored or sent anywhere?

No. Everything happens inside your browser. Your text is not uploaded, logged or read by anyone. The page remembers your last text on this device only, so you can pick up where you left off; press Clear to remove it.

Related tools