JSON is everywhere, but it's annoyingly strict: every key must be double-quoted, strings can't use single quotes, and a trailing comma after the last item is a syntax error. JSON5 was created to fix exactly that. Here's what's different and why it matters when you're dealing with JSON written by humans.
What JSON5 changes
The same data, strict JSON on the left, JSON5 on the right:
{
"name": "John",
"skills": ["js", "react"]
}{
name: 'John', // comment
skills: ['js', 'react',],
}- Unquoted keys.
nameinstead of"name". - Single-quoted strings.
'John'works just like"John". - Comments. Line comments with
//and block comments with/* */. - Trailing commas. A comma after the last item is allowed.
- Extended numbers. Hex like
0xFF, plusInfinityandNaN.
Where JSON5 shows up
You've almost certainly met it without knowing. Configuration files in modern JavaScript tooling are often JSON5 or something close to it, and a lot of "JSON" people paste into formatters is actually JSON5 they wrote by hand — single quotes, comments, forgotten double quotes. Strict tools just reject it.
Why the output still matters
JSON5 is great for humans, but the systems you send data to still expect strict JSON. That's the gap a good formatter fills: it reads JSON5 the way a person does, then writes clean, double-quoted, standards-compliant JSON that any parser accepts.
JSONGuy does exactly that. Paste JSON5, JavaScript-style objects, or even a Python dict, and it normalizes everything into valid JSON with syntax highlighting and a collapsible tree view. Try it in the JSON5 formatter, or convert a Python dict to JSON.