JSON Validator

Paste your JSON to check it. If it's broken, you'll see the line, the column and what to change: not just "Unexpected token".

Runs only in your browser.
Invalid JSON
Your JSON
Result
400 B · 11 lines

Get a URL for this JSON

Fix the errors first: only valid JSON can be hosted.

How to use it

  1. Paste your JSON in the box, drop a .json file on it, or open a file.
  2. The result appears as you type. A green check means the JSON is valid.
  3. If it isn't, read the message and click "Show in the text" to jump to the spot. Fix it, and the check runs again.
  4. Then format it, minify it, open it in the tree view, or host it to get a URL.

Common JSON errors and how to fix them

These are the errors we see most. Each message below is what the validator shows for that JSON.

Trailing comma

The most common error: a comma after the last item, often left when a line is deleted or moved.

Invalid

{
  "name": "Ada",
  "role": "admin",
}

The validator says

Trailing comma before } Line 3, column 18
JSON doesn't allow a comma after the last item. Delete this comma.

Fixed

{
  "name": "Ada",
  "role": "admin"
}

Missing comma between items

Each item but the last needs a comma. The validator points at the end of the line where it goes.

Invalid

{
  "name": "Ada"
  "role": "admin"
}

The validator says

Missing comma Line 2, column 16
Two items follow each other with no comma between them. Add a comma at the end of line 2.

Fixed

{
  "name": "Ada",
  "role": "admin"
}

Single quotes and keys without quotes

JavaScript accepts them, JSON doesn't: keys and text need double quotes.

Invalid

{ name: 'Ada' }

The validator says

The key name isn't in quotes Line 1, column 3
In JSON every key is text in double quotes: write "name" instead of name.

Fixed

{ "name": "Ada" }

Python values

Printing a Python dict gives True, False and None. JSON writes true, false and null.

Invalid

{ "active": True, "manager": None }

The validator says

True isn't a JSON value Line 1, column 13
JSON writes it in lowercase: true. True, False and None come from Python.

Fixed

{ "active": true, "manager": null }

Comments

Config files often have comments, but JSON has none. Remove them, or use a JSONC or JSON5 parser.

Invalid

{
  // the API base URL
  "api": "https://example.com"
}

The validator says

Comments aren't allowed in JSON Line 2, column 3
Remove the comment. A file with comments is JSONC or JSON5, which plain JSON parsers reject.

Fixed

{
  "api": "https://example.com"
}

JSON cut off

A response that was cut, or a bracket deleted by mistake: the validator says which bracket is never closed.

Invalid

{
  "users": [
    { "id": 1 },
    { "id": 2 }
}

The validator says

Expected ] but found } Line 5, column 1
The [ opened on line 2 has to be closed with ] first.

Fixed

{
  "users": [
    { "id": 1 },
    { "id": 2 }
  ]
}

Need a URL for this JSON?

Host it on JSONhost: your app reads it with a GET request, and you edit it from the website, the API or an AI agent.

Every hosted file is also an API. Read it, or a single value of it, and replace or patch it from your code.

Read the API docs

Read the whole file

curl https://jsonhost.com/json/abc123

Read one value

curl https://jsonhost.com/json/abc123/products/0/price

Change one field (JSON Patch)

curl -X PATCH https://jsonhost.com/json/abc123 \
  -H "Authorization: YOUR_FILE_TOKEN" \
  -d '[{ "op": "replace", "path": "/open", "value": false }]'

Questions

How do I check if a JSON is valid?

Paste it in the box at the top of this page. The validator checks it as you type: a green "Valid JSON" means any program that reads JSON will accept it. If it's invalid, you'll see the line and column of the first error, a plain explanation, and how to fix it.

What does "Unexpected token in JSON at position" mean?

It's the error JavaScript's JSON.parse gives. The position is the number of characters from the start of the text, which is hard to find by hand. Paste the same JSON here to see the line and column instead, and what the unexpected character is doing there. Often it's a trailing comma, a single quote, or a response that is HTML instead of JSON ("Unexpected token <").

Is my JSON sent to a server?

No. The validator runs entirely in your browser, so you can check API keys, customer data or private configs safely. Nothing leaves your computer unless you click "Host this JSON".

Does it accept comments or trailing commas?

No, on purpose. They aren't part of the JSON standard (RFC 8259), so most parsers reject them. The validator tells you where they are so you can remove them. Files with comments are usually JSONC (VS Code settings, tsconfig.json) or JSON5.

Why does it warn about valid JSON?

Two things are valid but often cause bugs. Duplicate keys: most programs silently keep the last value. Whole numbers above 9007199254740991: JavaScript and many other languages round them, so an ID can change. The validator shows both as warnings, not errors.

How large a JSON can I check?

Files of tens of megabytes work in a recent browser. Above a few megabytes the check waits until you stop typing.

How do I get a URL for my JSON?

Click "Host this JSON". JSONhost stores it and gives you a URL your app can read with a GET request. You can then change it from the website, with the API, or through an AI agent, without releasing a new version of your app.

More JSON tools

All JSON tools

Host your first JSON in the next minute.

Upload a file, get a URL, and go back to building the part of your product that people see.