Input
Output
Empty Formatting runs in your browser

Online JSON Validator

Check whether your JSON is valid and find the exact line and column of any error. The JSON validator follows the official JSON standard, so it catches trailing commas, single quotes, unquoted keys, comments and missing brackets, and shows valid JSON as a tree you can explore.

How to validate JSON

  1. Paste your JSON into the left editor, or open or drop a .json file.
  2. Press Validate or Ctrl+Enter. With Live on, the JSON is checked as you type.
  3. If the JSON is valid, the status line turns green and shows its type, number of keys and size, and the right editor shows it as a tree.
  4. If it is invalid, the status line shows the line, the column and the reason, and the editor marks the line. Fix it and the check runs again.

JSON syntax rules

The validator checks your text against the JSON standard (RFC 8259). Valid JSON follows these rules:

Common JSON errors and how to fix them

Trailing comma

{"a": 1, "b": 2,} fails because of the comma before the closing brace. Remove it. JavaScript allows trailing commas, JSON does not.

Single quotes

{'a': 'b'} fails because JSON only accepts double quotes. Replace them: {"a": "b"}.

Unquoted keys

{name: "Ada"} is a valid JavaScript object but not valid JSON. Quote the key: {"name": "Ada"}.

Missing comma or bracket

A missing comma between two items, or a bracket that is never closed, is reported at the point where the parser got confused, which is often the line after the real mistake. Look at the line above the reported one too.

Comments

// like this or /* this */ are common in config files but are not part of JSON. Remove them, or use JSON Repair to strip them.

Python or JavaScript values

True, False, None and undefined are not JSON. Use true, false and null.

Unescaped characters in strings

A real line break or tab inside a string is invalid. Write \n and \t instead. The JSON Escape tool does this for you.

Understanding error messages

Browsers word parse errors in slightly different ways, but they mean the same few things:

Fix errors automatically

When the JSON came from JavaScript code, a log line, a Python print or an AI chatbot, the errors are usually the predictable kind. JSON Repair fixes trailing commas, quotes, unquoted keys, comments, Python constants and cut-off endings in one step, and gives you valid JSON back. If the input is a JSON document stored as a string, with \" everywhere, the JSON Parser decodes it.

Validate JSON in code

Valid JSON is not always the right JSON

This validator checks syntax: whether a parser can read the document. It does not check that required fields are present or that values have the right type. That is the job of a JSON Schema, and schema validation is on our list of upcoming tools. To see how two valid documents differ, use JSON Compare.

A private JSONLint alternative

Like JSONLint, this JSON validator follows the standard strictly and points to the exact error. It also formats the result, shows it as a tree, lets you save and share it, and runs entirely in your browser, so nothing you validate is sent to a server. It is free, with no sign-up and no limits.

Frequently asked questions

How do I validate JSON?

Paste your JSON into the left editor or open a file, then press Validate or Ctrl+Enter. Valid JSON shows a green status. Invalid JSON shows the line and column of the error, and the editor marks the line.

What are the most common JSON errors?

Trailing commas after the last item, single quotes instead of double quotes, keys without quotes, comments, missing commas between items, unclosed brackets, and values such as undefined, NaN or True that JSON does not allow.

Is this a JSONLint alternative?

Yes. Like JSONLint it checks JSON against the standard (RFC 8259) and points to the exact error, and it also formats the JSON, shows it as a tree and works without sending your data to a server.

Does the validator check JSON Schema?

Not yet. This page checks that the JSON is well formed, which is what every parser needs. Checking JSON against a schema is planned as a separate tool.

Can it fix invalid JSON for me?

Yes, for common problems such as trailing commas, single quotes, comments or missing brackets. When the validator finds one it can fix, a Fix JSON button appears in the status line. Press it to repair the input, or press Ctrl+Z to undo the repair.

Why does valid JavaScript fail as JSON?

JSON is stricter than JavaScript. Keys and strings must use double quotes, trailing commas and comments are not allowed, and values like undefined, functions and NaN do not exist in JSON.

Download JSON

Save to this browser

Saves both the input and the output. Stored only in this browser on this device; use Export in Saved to back it up.

Share

Anyone with the link can see this JSON. Leave out passwords, tokens and personal data.

Shares the input and the output together.

Editor settings

Type

{
  "id": 1024, "name": "Ada", "active": true,
  "tags": ["0O", "1lI", "=> != >="], "manager": null
}

Colour theme

Code editor

Defaults

Saved JSON

    Nothing saved yet

    Press Ctrl+S or use Save on the toolbar to keep JSON here. It stays in this browser and is never uploaded.

    Stored in this browser only, not in an account. Saved JSON and links are lost if you clear your browsing data, use a private window, switch browser or device, or the browser frees up space. Use Export all now and then to keep a copy.

    Send feedback

    How is online-json working for you?