Data & CSV

JSON Validator

JSON Validator

Check JSON for errors with line and column, plain-language causes and one-click repair.

About this tool

About JSON Validator

Paste JSON and find out at once whether it is valid. When it isn't, the validator points to the exact line and column, shows the surrounding lines with a caret under the problem, and explains the cause in plain words: a trailing comma before a closing bracket, a key without double quotes, a string that is never closed, a stray comment. Many "almost JSON" snippets come from JavaScript code, JSON5 config files or Python print output, so the tool also recognises those patterns and offers a Fix JSON button that converts single quotes, unquoted keys, comments, trailing commas, NaN, hex numbers and Python True/False/None into strict JSON. Valid documents get a short report with the number of keys, values, objects, arrays and the maximum nesting depth, plus warnings for duplicate keys, which most parsers silently overwrite. It also spots JSON Lines files pasted by mistake. Validation runs in your browser, so private API responses and config secrets never leave your device. If the built-in repair can't help, an optional AI fix using your own key explains and corrects the JSON.

Built and maintained by Abhi JainUpdated

How to Validate JSON

  1. 1

    Paste or open JSON

    Paste JSON into the JSON pane, drop a .json file onto it, or click Sample to try an example with mistakes.

  2. 2

    Read the result

    The Result panel says Valid JSON or Invalid JSON. For errors it shows the line, column, the highlighted line and the likely cause.

  3. 3

    Fix and format

    Click Fix JSON to repair common mistakes automatically, then use Format or Minify and copy the result.

JSON Validator: questions and answers

What makes JSON invalid?

The most common causes are a trailing comma after the last item, keys or strings in single quotes, keys without quotes, comments, and unescaped line breaks or quotes inside strings. JSON (RFC 8259) allows none of these.

Can it fix my JSON automatically?

Yes, for the usual JSON5 and JavaScript-style mistakes: trailing commas, comments, single quotes, unquoted keys, NaN or Infinity, hex numbers and Python True/False/None. Mismatched brackets or missing values still need a human decision, so the tool shows where they are instead of guessing.

Are duplicate keys valid JSON?

The standard says keys should be unique but doesn't forbid duplicates, so most parsers accept them and keep only the last value. The validator warns you because the earlier values are silently lost.

What is the difference between JSON and JSON5?

JSON5 is a superset meant for hand-written config files. It allows comments, trailing commas, single quotes and unquoted keys. APIs and most parsers only accept strict JSON, so convert JSON5 before sending it.

Is my JSON uploaded?

No. Validation happens in your browser and nothing is sent to a server.

Can AI fix invalid JSON?

Yes, as a second option. Try the built-in Fix JSON first: it's exact and needs no key. Otherwise click AI: your JSON and the error are sent, and the corrected version is checked here before you can use it. It's optional and uses your own AI key (Claude, OpenAI, Gemini, DeepSeek, OpenRouter or a compatible endpoint), sent straight from your browser to that provider; KissThePDF never sees it. Without a key the tool works exactly the same.