Overview
JSON5 relaxes JSON’s strict grammar for the sake of hand-written config files: it allows line and block comments, trailing commas in objects and arrays, unquoted (or single-quoted) object keys, single-quoted strings, and a handful of other conveniences that a strict JSON.parse would reject outright. This tool validates against the real JSON5 grammar using the JSON5 library rather than approximating it, so a config file with comments and trailing commas gets an honest pass/fail verdict instead of a false "invalid JSON" error from a parser that was never built to accept it. Valid input is also shown re-serialized as strict, standard JSON, so you can see exactly what a downstream JSON.parse-only consumer would receive. Runs entirely client-side; nothing you paste is ever uploaded.
Best for: Validating a hand-written JSON5 config file that uses comments and trailing commas
How to use this tool
- Paste JSON5. Comments, trailing commas, unquoted keys, and single-quoted strings are all accepted.
- Get a real verdict. Parsed with the JSON5 grammar, not a strict JSON.parse that would reject valid JSON5.
- See the strict-JSON equivalent. Valid input is re-serialized as standard JSON so you know what a plain JSON.parse consumer would see.
Frequently asked questions
They overlap but aren’t identical. JSON5 allows comments plus several other relaxations (trailing commas, unquoted keys, single-quoted strings, hex numbers, leading decimal points); JSONC as used by some tools (like VS Code’s settings files) typically only adds comments and trailing commas on top of JSON. This tool validates specifically against the JSON5 grammar.
Strict JSON.parse has no concept of comments, trailing commas, or unquoted keys at all - it throws a syntax error the moment it hits any of them. There’s no way to "ignore" that syntax with the standard parser; you need a parser that actually understands the JSON5 grammar, which is what this tool uses.
It validates and shows the strict-JSON equivalent of valid input, but it doesn’t reformat the original JSON5 source itself (which would require deciding how to preserve or restructure comments). For pretty-printing plain JSON, use the JSON Formatter.