JSON Validator

Check whether your JSON is valid and see the exact line and column of any error. Validate on demand or turn on Live to check as you type — and when it is broken, auto-repair offers a deterministic, previewed fix you apply yourself. Everything runs on your device, so your data stays private and is changed only when you choose to apply a repair.

Input JSON

Paste JSON or open a .json file, then choose Validate.

Validation runs in this browser. Your JSON is not sent to a server.

Check whether your JSON is valid and see the exact line and column of any error. Paste JSON into the editor or open a .json file from your device, then choose Validate — or switch on Live to check it as you type. When the input is broken, Auto-repair offers a deterministic, previewed fix that you apply yourself. Validation and repair both run on your device with the browser’s built-in JSON parser, so your data stays private: nothing is uploaded, and nothing is rewritten unless you explicitly choose Apply repair.

How to use the JSON validator

  1. Paste or open your JSON — Paste JSON into the editor, or open a .json file from your device.
  2. Choose Validate, or turn on Live — Select Validate to check the syntax, or switch on Live to recheck automatically about 300 ms after you stop typing. Empty input stays idle and produces no verdict.
  3. Read the result and the error location — A valid result reads ✓ Valid JSON and adds chips for the root type (object, array, string, number, boolean, or null), the number of keys for an object or items for an array, and the size in bytes. An invalid result reads ✕ Invalid JSON, followed by a plain-language explanation and Line X, Column Y when that position is known.
  4. Jump to the error and fix it — The editor marks the offending line. Choose Jump to error to scroll straight to it, correct the JSON, and validate again. Clear empties the input and the result so you can start a new check.
  5. Or auto-repair it, then review the preview — Choose Auto-repair to see the safe fixes that apply, listed as chips, with the repaired JSON in a read-only preview. Nothing changes until you choose Apply repair, which replaces the input and re-validates immediately.

Reading an invalid result

An invalid result leads with a short, human-readable sentence that names the likely problem — for example a trailing comma before a closing brace, or a string that is not closed. Below it you get the exact Line X, Column Y when the parser reports a position, plus the original parser message as a technical detail. The editor highlights the same line so you can see it in context. If you need to share the problem, Copy error details puts the summary, the line and column, and the raw message on your clipboard in one step. You can also choose Auto-repair to have the validator propose a fix.

Auto-repairing invalid JSON

When the JSON is invalid, Auto-repair runs a fixed, deterministic set of safe corrections and only reports success if the result actually parses:

  • Removing trailing commas before } or ].
  • Adding double quotes around unquoted property names, such as {name: …} → {"name": …}.
  • Converting single-quoted strings to double-quoted strings.
  • Replacing curly or typographic quotes (" " ' ') with straight quotes.
  • Replacing the Python literals True, False, and None with true, false, and null.

Every change is listed, and the repaired text appears in a read-only preview — your input is untouched. Choose Apply repair to replace the input with the repaired JSON and re-validate it in one step; choose Dismiss to leave the original as it is. If the safe fixes are not enough, the validator says it could not repair the JSON automatically and keeps the invalid result, so you can fix it by hand. There is no AI and no guesswork, and a repair is never applied silently or automatically.

What counts as valid JSON here

The validator asks one question: does this text follow JSON syntax? It follows the JSON standard rather than JavaScript, so the following are all valid and accepted: a bare top-level value such as 42, "text", or null; nested objects and arrays of any depth; escaped characters such as \n and \u00e9; and numbers written in either integer or exponent form. Duplicate keys are also accepted, because the JSON parser keeps the last one.

What it does not do: it does not compare your data against a JSON Schema, check that fields are the type or shape your application expects, or warn you about repeated keys. A “valid” result means the text parses — nothing more.

Common JSON errors and what they mean

The message you see comes from your browser’s JSON parser, and it points at the character where parsing stopped. That is usually the first thing to fix, but not always the actual mistake — a missing comma five lines earlier can make the parser complain about the value that follows it.

  • Unexpected token … — the parser met a character that cannot appear where it is. Typical causes: a missing comma between two items, a stray character, a JavaScript-only literal such as NaN, undefined, or Infinity, a // comment, or a smart quote (" or ") pasted from a word processor. Read the position in the message, then inspect the characters just before it.
  • Trailing comma before } or ] — {"name": "ToolNava",} and [1, 2, 3,] are invalid, even though JavaScript allows them. Chrome reports the closing bracket as an unexpected token, or says it expected a double-quoted property name. Delete the final comma.
  • Unquoted keys — {name: "ToolNava"} is not JSON: object keys must be double-quoted strings. The parser stops at name and expects a quoted property name, so it reports the error at that column. Write {"name": "ToolNava"}.
  • Single quotes instead of double quotes — {'name': 'ToolNava'} fails for the same reason. JSON accepts only " around keys and strings, and a literal newline inside a string is invalid — it must be escaped as \n.
  • Unclosed brackets or braces — in {"items": [1, 2}, the array was never closed, so the parser reaches the } where a , or ] was expected and points at that line. When the input simply ends, for example {"items":, the parser reports Unexpected end of JSON input and may give no position at all; the tool then shows an invalid result with no line and column, and the fix is usually the last missing } or ].

Is it private?

Your JSON never leaves your device. The page parses it in the browser, so there is no upload step, no copy kept on a server, and no stored history — the tool has no backend that could retain your input. You do not need an account, and no AI is involved: because validation and auto-repair are deterministic, the same input always gives the same result, and your data is never rewritten on its own — a repair is shown as a preview and applied only when you choose Apply repair. Licensed or customer data can therefore be checked without sending it anywhere. For a formatted or minified version of valid JSON, use the JSON Formatter; to go the other way with encoded text, see Base64.

Frequently asked questions

How do I find the line number of a JSON error?

Paste the JSON into the editor and choose Validate — or turn on Live to check it as you type. If the syntax is broken, the editor highlights the offending line, the result shows a plain-language message together with Line X, Column Y, and the Jump to error button scrolls the editor straight to that spot.

Does the validator explain errors in plain language?

Yes. Common parser errors are rewritten into a short, human-readable sentence — for example a trailing comma or a string that is not closed. The original parser message is still shown underneath as a technical detail, so you can compare it with what your browser reports.

Can I copy the error details?

Yes. When the JSON is invalid, choose Copy error details to copy a short summary to your clipboard: the plain-language message, the line and column, and the raw parser message. It is handy when you want to paste the problem into a bug report or a chat.

Can the validator check JSON while I type?

Yes. Switch on Live and the validator rechecks automatically, waiting about 300 ms after your last keystroke before it runs. While Live is off you validate on demand with Validate. Empty or whitespace-only input stays idle and produces no result.

Does ToolNava fix invalid JSON?

It can, but only if you ask. When the input is invalid, choose Auto-repair to see a preview of the safe fixes that apply — such as removing a trailing comma, quoting a bare property name, or straightening smart quotes — and the changes are listed for review. Your input is replaced only when you choose Apply repair, so the validator never edits your data on its own.

How does auto-repair work, and is it AI?

No AI is involved. Auto-repair applies a fixed, deterministic list of safe corrections: removing trailing commas, adding double quotes around unquoted property names, converting single-quoted strings to double-quoted strings, replacing curly or typographic quotes with straight ones, and replacing Python literals True, False, and None with true, false, and null. It reports success only when the repaired text actually parses, and it shows both the list of changes and a read-only preview. Because it never guesses beyond those safe fixes, it may report that some JSON cannot be repaired automatically — an automatic or silent rewrite never happens.

Is it safe to paste JSON into this validator?

Yes. Validation runs in your browser with the built-in JSON parser. Your JSON is never uploaded, never stored on a server, and no account is required, so an API response or config file can be checked without sharing it with anyone.

Does it use AI to check JSON?

No. Validation is deterministic: it calls the browser's own JSON parser, so the same input always produces the same result. Auto-repair is deterministic too — it applies a fixed list of safe corrections rather than guessing. There is no AI step, which means nothing can quietly rewrite or "improve" your data; a repair appears as a preview and is applied only when you choose Apply repair.

What does "valid JSON" mean here?

It means the value follows JSON syntax: double-quoted keys, commas between items, balanced braces and brackets, and only allowed value types. The validator does not check a JSON Schema, field types, or business rules, so syntactically valid data can still be wrong for your application.

Can I validate JSON from a file?

Yes. Choose Open .json file and pick a file from your device. The file is read locally in the browser and is not uploaded; the contents appear in the editor, where you still choose Validate — or turn on Live — to check them.

Why does the error message look different in another browser?

The wording comes from the browser's own JSON parser, and Chrome, Edge, Firefox, and Safari describe the same problem differently. ToolNava adds a plain-language summary and the line and column it can derive from that message, so the phrasing may vary slightly while still pointing at the same character.