JSON Validator - Check & Fix JSON Errors Online (Free)

Validate JSON instantly. Pinpoints the exact line and column of every error - trailing commas, bad quotes, missing brackets. Free, no upload, no sign-up.

Tool options

Output

Indentation

Options

Saved documents

Saved JSON stays in this browser - nothing is uploaded.

Paste JSON - it formats as you type.
Input
Output

Catch every JSON error in seconds

Paste your JSON above and hit Validate. The checker highlights the exact line and column where the problem is, so you can fix it without hunting through hundreds of lines by hand.

No sign-up needed, no file uploads - everything runs right in your browser. Your data stays on your device.

How to use the JSON Validator

  1. Paste your JSON into the editor above.
  2. Click Validate (or just start typing - errors appear as you go).
  3. Read the error message: it tells you the line number, column, and what went wrong.
  4. Fix the highlighted spot, then validate again until you see the green Valid JSON checkmark.
  5. Optionally click Format to beautify the output once it's clean.

Worked example: spotting a real error

Here is a common broken payload - a trailing comma after the last key, which most JSON parsers reject:

{
  "user": "alice",
  "role": "admin",
  "active": true,
}

The validator flags: Error on line 5, column 1: Unexpected token }. Remove the comma after true and the document turns valid instantly:

{
  "user": "alice",
  "role": "admin",
  "active": true
}

Why is my JSON invalid? Common errors and one-line fixes

ErrorBad exampleFix
Trailing comma{"a": 1,}Remove the comma before the closing } or ]
Single-quoted strings{'key': 'value'}Switch to double quotes: {"key": "value"}
Unquoted key{key: "value"}Wrap the key in double quotes: {"key": "value"}
Missing comma between items{"a": 1 "b": 2}Add a comma: {"a": 1, "b": 2}
Unclosed bracket or brace[1, 2, 3Add the matching ] at the end
Python literalsTrue, False, NoneUse lowercase: true, false, null

Our validator points to the first error's exact line and column so you never have to guess. Fix the reported spot, validate again, and work through any remaining issues one at a time.

Validate JSON in your code (Python & JavaScript)

Sometimes you want to validate a JSON string programmatically rather than in a browser. Here's the standard way in each language.

Python - uses the built-in json module:

import json

raw = '{"user": "alice", "active": true}'  # note: true is valid JSON, not Python True

try:
    data = json.loads(raw)
    print("Valid JSON", data)
except json.JSONDecodeError as e:
    print(f"Invalid JSON at line {e.lineno}, col {e.colno}: {e.msg}")

JavaScript (Node.js or browser) - uses the native JSON.parse:

const raw = '{"user": "alice", "active": true}';

try {
  const data = JSON.parse(raw);
  console.log('Valid JSON', data);
} catch (e) {
  console.error('Invalid JSON:', e.message);
}

Both approaches throw a descriptive error you can log or surface in your UI. The online validator above does the same thing, just without writing any code.

How the validator works

The tool runs the JSON.parse algorithm - the same parser built into every modern browser - directly in your browser tab. No server ever sees your data.

When parsing fails, the engine captures the character position of the first syntax problem. The editor then scrolls to that line and underlines the offending spot. The official JSON spec at json.org (authored by Douglas Crockford) defines exactly what the parser accepts; our checker follows it strictly. You can also check the IETF RFC 8259, which is the current JSON standard.

When to use a JSON validator vs. other tools

  • Validate first when you're debugging an API response that your app can't parse - find and fix the error before doing anything else.
  • Format after validating to make the structure readable. Try our JSON Beautifier for pretty-printed output with adjustable indentation.
  • Minify before shipping to production to reduce payload size. Our JSON Minifier strips all whitespace in one click.
  • View nested data in a collapsible tree with the JSON Viewer.
  • Don't use a JSON validator if your data is actually JSONC (JSON with comments) or JSON5 - those are supersets that allow comments and trailing commas. A strict validator will reject them. Check your tool's docs to see which dialect it expects.
  • Converting formats? If you need to move between JSON and YAML, see our JSON to YAML Converter or the YAML to JSON Converter.

Your JSON is only ever processed in your own browser. Nothing is uploaded to our servers, so it's safe to paste API keys, tokens, or internal config while debugging - just remember to rotate any secrets after you're done.

Paste your JSON above and let the validator do the work - a green checkmark means you're good to go.

Frequently asked questions

Is my JSON data uploaded to your servers?+
No. The validator runs entirely in your browser using JavaScript's built-in JSON.parse. Nothing is sent to any server, so it's safe to paste private configs, API responses, or tokens while you debug.
What's the difference between validating JSON and formatting it?+
Validation checks whether your JSON is syntactically correct - it either passes or fails. Formatting (also called beautifying or pretty-printing) takes valid JSON and adds indentation to make it easier to read. You need valid JSON before you can reliably format it. Try the JSON Beautifier once your data is clean.
Why does the validator say my JSON is invalid even though it looks fine?+
The most common hidden culprits are a trailing comma after the last item, single quotes instead of double quotes, or a Python boolean like True instead of true. Check the exact line and column reported in the error message - the problem is almost always right there.
Can it validate very large JSON files?+
Yes, for most practical sizes. Because parsing happens in the browser, extremely large files (several hundred MB) may be slow or cause the tab to run out of memory depending on your device. For files in the megabytes range it works fine.
How do I validate JSON in VS Code?+
Open the file, then open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run Format Document. If the file extension is .json, VS Code's built-in language server highlights syntax errors in the Problems panel automatically. You can also set "editor.formatOnSave": true in your settings.
Is this tool free? Do I need to create an account?+
Completely free, no account needed. Paste your JSON and validate - that's it.
What is the difference between JSON and JSONC or JSON5?+
JSON (RFC 8259) is the strict standard - no comments, no trailing commas. JSONC and JSON5 are popular supersets that add those features, used by tools like VS Code's config files. A strict JSON validator will flag them as invalid. If your file uses comments or trailing commas intentionally, it's probably JSONC or JSON5 and needs a parser that supports that dialect.
Why does JSON require double quotes instead of single quotes?+
That's part of the JSON specification (RFC 8259). The spec defines strings as sequences wrapped in double quotes only. Single quotes are valid in JavaScript object literals, but not in JSON - which is why copy-pasting a JS object often produces invalid JSON.