Javascript is required

JSON Validator & Syntax Error Locator

Browser-Local Validation & Diagnosis

Check JSON syntax, BOM, invisible characters and trailing commas. Error locations depend on the browser parser.

Try JSON validation examples

Loading replaces the current input, then checks it without applying a repair. Bracketed U+ markers only make invisible characters visible in these cards; loaded input contains the original characters. These are local sample responses, not live API requests.

HTML API response

<!doctype html>
<html><body><h1>502 Bad Gateway</h1></body></html>

Invalid JSON; no repair. This HTML error-page sample has no guaranteed parser location. Check the API response before editing JSON.

Valid JSON

{
  "ok": true,
  "items": [1, 2]
}

Valid syntax; no repair. Input whitespace and values remain unchanged. This does not check a schema or API contract.

Trailing comma

{
  "items": [1, 2,]
}

Invalid syntax. A validated candidate removes only the comma before ]. The position may be unavailable in some engines; apply and review the repair explicitly.

Leading BOM

⟦U+FEFF⟧{"ok":true}

Invalid syntax. U+FEFF is at line 1, column 1; a validated candidate removes this leading BOM. It is also counted in the invisible-character list.

Zero-width character outside a string

{"id": 1⟦U+200B⟧2}

Invalid syntax. U+200B occurs at line 1, column 9 (UTF-16). No candidate is offered; removing a character between digits could change the value.

Truncated JSON

{"items": [1, 2

Invalid syntax; no candidate. A missing suffix cannot be inferred safely. Parser wording and error location depend on the engine.

Unescaped newline in a string

{"message": "first
second"}

Invalid syntax; no candidate. The raw newline is at line 1, column 19 (UTF-16); the reported parser location may differ. Decide whether it should be an escaped newline or another value.

Emoji and a large integer

{"emoji":"👩⟦U+200D⟧💻","id":9007199254740993}

Valid syntax; no repair. The emoji includes U+200D at line 1, column 13 (UTF-16), which must not be stripped. Parsing 9007199254740993 produces 9007199254740992 in this tool; it does not emit a precision warning or rewrite the original input.

Diagnose JSON syntax and review repairs

Paste the original response or load a case below the editor. Check syntax, BOM and invisible characters. When the browser parser provides a location, this tool shows its line and column; some errors have no location.

The source stays unchanged while checking. A repair appears only if removing a leading BOM or a trailing comma produces complete valid JSON; applying it still requires your review. Validation runs in browser memory, but sensitive-data privacy also depends on deployed scripts and network traffic.

Usage Boundaries & Limitations

  • Syntax validation is not JSON Schema validation: required fields, types and API contracts are not checked.
  • Numbers can pass syntax validation and lose precision when parsed as JavaScript numbers. Keep large identifiers as strings when your API contract allows it.
  • Invisible characters can be legitimate inside strings or emoji. They are listed, not removed globally; columns count UTF-16 code units.
  • HTML/XML-looking input, truncated documents and unescaped newlines do not receive speculative repairs. Check HTTP status, Content-Type and the actual response.

Frequently Asked Questions (FAQ)

Why does an API response fail with Unexpected token < or another parser message?▼

It may be an HTML error or login page instead of JSON. Inspect the HTTP status, Content-Type, final response URL and response body. Exact error wording and positions vary across browser engines.

Does valid JSON also satisfy JSON Schema?▼

No. This tool checks JSON syntax. A document can be valid JSON and still miss required fields or contain values of the wrong type for your schema or API.

Which repairs are suggested, and can they change valid JSON?▼

Valid source remains unchanged. A leading BOM or trailing comma is removed only when the complete candidate parses successfully. Invisible string characters, single quotes, truncated data and raw newlines are not automatically rewritten. Review every suggested repair.