Skip to content

How to format, validate and fix JSON

Turn messy JSON into readable, indented text, find the exact line of a syntax error, and shrink it back down.

Open the JSON Formatter & Validator โ†’

JSON from an API or a log is usually one long line. Formatting adds indentation so you can read it; validating tells you whether it is legal JSON at all.

Steps

  1. Open the JSON Formatter.
  2. Paste your JSON (or press Sample to see how it works).
  3. Set Mode to Format, Minify or Validate only.
  4. Copy or download the result.

Options: Indent (2 spaces, 4 spaces or tab) and Sort keys Aโ€“Z, which makes two files easy to compare.

Reading an error

When the JSON is invalid, the message points at the line. The mistakes we see most:

  • A trailing comma after the last item.
  • Single quotes instead of double quotes.
  • An unquoted key, such as {name: "Ada"}.
  • A missing closing bracket.

Fix the line it names, then run it again.

Need it as a spreadsheet?

The JSON to CSV tool turns a list of objects into rows. If you paste JSON into the CSV โ†’ JSON direction by mistake, it tells you to switch direction.

Private by design

API responses often contain real customer data. This formatter runs in your browser, so what you paste is not sent to us.

Related tools

JSON to CSV ยท JSON to XML ยท Base64 ยท JWT Decoder

Open the JSON Formatter & Validator โ†’

More guides

Browse

WorkflowsChain tools into one-button recipes
All tools55 tools Words & Lists15 tools Images & Photos7 tools PDF Toolbox6 tools Code & Data8 tools Encode & Decode4 tools Hash & Security4 tools Numbers & Measures5 tools Creators & Social3 tools Handy Extras3 tools