Skip to main content
100% Local Processing (Local Web Worker) — Files Never Leave Your Browser
Engine: json-utility

JSON Validator

Validate JSON syntax against RFC 8259 with exact line and column diagnostics and one-click auto-fix for trailing commas and comments.

Local Workspace (json-utility)

How to Use JSON Validator

  1. 1Paste the JSON or JSONC configuration file you want to inspect into the Input JSON pane (or click Load JSONC Sample).
  2. 2Check the RFC 8259 Status card and the syntax error banner for the exact 1-based Line and Column number and visual caret pointer (^).
  3. 3If comments or trailing commas are present, click Auto-Fix Comments & Trailing Commas to repair the payload into strict RFC 8259 JSON.

Technical Specifications & Guardrails

  • Pinpoints exact 1-indexed Line and Column numbers via native parser positions and an RFC 8259 lexical scanner
  • Renders a monospace code excerpt with a visual caret (^) pointing directly to the offending token
  • String-aware Auto-Fix strips // and /* */ comments and trailing commas without corrupting URLs inside strings
  • Executes inside a resilient Web Worker guarded by WorkerClient timeout recovery up to 10 MB

Practical Example: Repairing a VS Code tsconfig / JSONC Snippet for Strict Parsers

Sample Input
A configuration file containing // comments, /* block comments */, and trailing commas after the last array item that fails strict JSON.parse().
Verified Local Output
Pinpoints the exact comment/comma line and repairs the file into valid RFC 8259 JSON in one click while preserving 'https://...' URLs inside string values.

Operational Limits & Browser Guardrails

Validates payloads up to 10 MB against strict IETF RFC 8259 rules. Auto-Fix repairs JSONC comments (// and /* */) and trailing commas before } or ]; structural syntax errors such as unquoted keys, single-quoted strings, or missing colons are highlighted by line and column for manual correction.

Frequently Asked Questions

What errors can Auto-Fix JSONC repair automatically?

The string-aware repair scanner strips single-line (//) and multi-line (/* */) comments and removes trailing commas before closing braces (}) or brackets (]) while leaving '//' or '/*' sequences inside quoted string literals untouched.

Does the JSON Validator use eval() or new Function() to parse input?

No. Validation uses native JSON.parse() and a deterministic lexical scanner inside a local worker, never executing untrusted input as JavaScript code.

Why does RFC 8259 reject trailing commas and single quotes?

IETF RFC 8259 mandates double-quoted property names and forbids trailing commas to guarantee interoperability across C, Go, Rust, Python, and Java parsers.