Hype StackHypeStack

JSON validator that shows the fix.

Paste JSON and see right away whether it parses. When it doesn't, you get where, why and what to change.

  • Free
  • No signup
  • Runs in your browser

Checked against the JSON standard (RFC 8259), the same rules JSON.parse, APIs and package managers use. Comments, trailing commas and single quotes are errors here, because they are errors there.

How it works.

  1. 1

    Paste the JSON that's failing, or open the file. The sample has a classic mistake in it.

  2. 2

    The check runs as you type. An error shows its line and column, and the line itself with a caret under the problem.

  3. 3

    Read the hint, click Show in editor to jump to the spot, fix it, and watch it turn valid.

The mistakes that break JSON most often

A comma after the last item. Single quotes instead of double quotes. Keys without quotes. Comments. Python's True and None, or JavaScript's undefined, pasted from a console. All of these work in JavaScript and all of them are errors in JSON.

The validator calls each of these out by name instead of saying "Unexpected token", and points at the character that caused it.

Why "Unexpected token" doesn't help

JSON.parse stops at the first character it can't use and reports an offset into the text. In a 2,000 line file, "position 48213" means nothing. And the real mistake is often earlier: a missing comma surfaces as an error on the next line.

Here the error comes as a line and column with the two lines before it, so you can see the missing comma, not just the line that tripped over it.

Questions, answered.

How do I check if JSON is valid?

Paste it into the box above. Valid JSON gets a check mark with the number of keys and the nesting depth. Invalid JSON gets the line and column of the first error and how to fix it.

Why is a trailing comma invalid in JSON?

The JSON standard, RFC 8259, only allows commas between items. JavaScript, TypeScript and JSON5 accept one after the last item, which is why it slips into files so often. Delete it and the file parses.

Can JSON have comments?

No. Plain JSON has no comment syntax. Files like tsconfig.json and VS Code settings use JSONC, a variant that allows them. If a tool expects plain JSON, remove the comments or move the notes into a field.

Does JSON allow single quotes?

No. Strings and keys both need double quotes: 'name' is an error, "name" is fine. It's the most common mistake when JSON is typed by hand or copied from Python output.

What does "Unexpected end of JSON input" mean?

The text stopped before every bracket was closed, usually because a response was cut off or a copy missed the last line. The validator shows which { or [ was never closed and where it was opened.

More free tools.

All tools

Stop hand-checking payloads.

Add an endpoint that lists invoices and show them in the web app.. Add a settings page that saves to the API.. Let people sign in with Google.

In Hype Stack the apps and the API share one set of types, so a wrong field fails the build instead of the screen. Free and open source.