Client-side · RFC 8259 Diagnostics

JSON Validator & Syntax Error Locator

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

Browse All Tools

Browser-Local Validation & Diagnosis

Waiting for input
JSON Input Source0 ln · 0 B
Diagnostics & Location

Paste a raw payload on the left or load a test case below to inspect syntax, BOM, and invisible characters.

Test Cases

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.

01 / CASE

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.

02 / CASE

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.

03 / CASE

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.

04 / CASE

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.

05 / CASE

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.

06 / CASE

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.

07 / CASE

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.

08 / CASE

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.

Concept & Workflow

What Is a JSON Validator & Syntax Error Locator?

A JSON syntax validator checks whether API responses or configuration payloads strictly follow RFC 8259. Instead of stopping at a generic parse failure, this browser-local tool surfaces hidden issues behind production errors, including HTML error pages, leading UTF-8 BOM (U+FEFF), zero-width characters, and trailing commas.

  • Parser line/column location: displays exact error coordinates and nearby context snippets whenever supplied by the browser engine.
  • BOM & invisible-char inspection: lists U+FEFF, U+200B, and U+200D offsets in UTF-16 units without blindly stripping valid emoji ZWJ sequences.
  • Conservative repair candidates: proposes fixes only when removing a leading BOM or trailing comma yields complete valid JSON.

How to Validate & Debug JSON Errors Online

  1. 1Paste raw input: drop your API payload into the left editor, or click any of the 8 real-world cases below.
  2. 2Review the 4-metric summary: check JSON syntax status, BOM marker, zero-width characters, and trailing commas on the right.
  3. 3Inspect parser diagnostics: read the reported line/column, browser error text, and markup warning if the response starts with <.
  4. 4Apply & verify repairs: when a validated candidate appears, click "Apply Suggested Repair" and review numbers and strings manually.

Related examples and guides

Deep Dive

Documentation

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.
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.

Should zero-width characters like U+200B or U+200D always be removed from JSON?+

Not always. Zero-width characters outside strings cause syntax failures, while ZWJ emoji sequences (such as 👩‍💻) legitimately depend on U+200D inside string literals. This validator lists each UTF-16 position without stripping them globally so you can decide safely.