Free tool · no sign-up

JSON Formatter & Validator

Paste JSON to check it's valid, format it with clean indentation or minify it. If something's wrong, you get the line and column of the error and a pointer to it. Switch to the tree view to browse big API responses.

By Jamiul Alam Rejon · Updated

The formatted JSON shows here.

Runs in your browser with its built-in JSON engine. Nothing is sent or saved.

Quick answer

To validate JSON, paste it into the box: valid JSON is formatted straight away, and invalid JSON shows the error with its line and column. Valid JSON uses double quotes for every key and string, has no trailing commas or comments, and its only values are strings, numbers, true, false, null, objects and arrays.

JSON rules in one table

RuleValidInvalid
Keys in double quotes{"name": "Ana"}{name: "Ana"}
Strings in double quotes"hello"'hello'
No trailing comma[1, 2, 3][1, 2, 3,]
No comments{"a": 1}{"a": 1 // one}
Lower-case literalstrue, false, nullTrue, NULL, undefined
Plain numbers0.5, 10, -3e2.5, 010, NaN

How to fix an “Unexpected token” error

  1. Go to the line and column the tool shows. The pointer marks where the parser gave up.
  2. Look just before that point too. A missing comma on the line above often shows up as an error at the start of the next line.
  3. Check for a trailing comma before a closing } or ].
  4. Replace single quotes and curly “smart” quotes copied from a document with straight double quotes.
  5. If the text starts with <, it's HTML, not JSON: the server probably returned an error page.

Where you'll meet JSON

API responses, app config files, package.json, WordPress and Shopify exports, webhooks from tools like n8n, and the structured data that helps Google understand your pages. That last one is JSON-LD, and you can build it without writing any JSON by hand using the Schema Markup Generator.

Frequently asked questions

How do I check if JSON is valid?

Paste it in the box. The tool parses it as you type and shows “Valid JSON” or the error with its line and column (in Chrome, Edge and Firefox), and a pointer to the exact character.

What are the most common JSON errors?

A trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, and a missing comma or bracket. All of these are allowed in JavaScript but not in JSON.

Can JSON have comments?

No. The JSON standard doesn't allow comments. Some tools accept JSONC or JSON5, which do, but a standard JSON parser will reject them.

What's the difference between formatting and minifying?

Formatting adds line breaks and indentation so people can read it. Minifying removes all extra whitespace so the file is as small as possible for sending over a network. The data is identical.

Does sorting keys change the data?

No. Objects in JSON have no meaningful key order, so sorting them A–Z keeps the same data while making two versions easier to compare. The order of items in arrays is never changed.

Is my JSON uploaded?

No. It's parsed by your browser's built-in JSON engine. Nothing is sent or saved, so it's safe for API responses and config files.