Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

JSON Validator

Paste any JSON. The status line says ✓ valid or ✗ with the parser's error message and offset.

What "valid JSON" means

JSON is defined by RFC 8259. Valid JSON consists of:

What's NOT valid JSON

Common things people confuse for JSON:

Reading parser errors

Browser JSON.parse errors are concise. Examples:

ErrorLikely cause
Unexpected token } in JSON at position 47Trailing comma before } or ]
Expected double-quoted property nameUnquoted key or single-quoted key
Unexpected end of JSON inputTruncated — missing closing brace or bracket
Unterminated string in JSONNewline inside a string, or missing closing quote
Unexpected number in JSONLeading zero (0123) — JSON doesn't allow it

Validating in code

// JavaScript / TypeScript
function isValidJson(s) {
  try { JSON.parse(s); return true; }
  catch { return false; }
}

// Python
import json
def is_valid(s):
    try: json.loads(s); return True
    except json.JSONDecodeError: return False

// Bash with jq
echo "$INPUT" | jq empty 2>/dev/null && echo valid

// Go
import "encoding/json"
var v interface{}
err := json.Unmarshal([]byte(input), &v)

Beyond syntactic validation

"Valid JSON" only means parseable. To enforce shape (this object must have a name string and an age integer), use JSON Schema or a runtime validator like Zod (TypeScript) or Pydantic (Python).

FAQ

What's the difference between this and the formatter?

Same engine — both use the browser's JSON.parse. The validator page just frames the UX around 'is this valid?' rather than 'show me the formatted output'. The status line is the answer either way.

Does it validate against a JSON Schema?

No — this tool checks syntactic validity (is the input parseable?). For schema validation against a contract, you need a JSON Schema validator. We're considering adding one as a separate tool; sign up below to be notified.

What error messages will I see?

Whatever your browser's JSON.parse emits — typically 'Unexpected token X at position N' or 'Expected double-quoted property name'. The position is a byte offset; line numbers aren't shown but you can usually find the spot from the offset.

Are JSONC, JSON5, NDJSON valid here?

No — strict JSON only. JSONC (with comments), JSON5 (looser syntax), and NDJSON (newline-delimited) are different formats. The strict validator will reject them at the first non-standard character.