JSON5 to JSON
Convert JSON5 or JSONC (comments, trailing commas) to strict JSON and back.
About this tool
Paste a JSON5 or JSONC file, such as tsconfig.json or VS Code settings, and get standard JSON, minified or indented. Errors point to the exact line and column. Switch direction to turn JSON into tidy JSON5 with unquoted keys and trailing commas.
JSON5 vs JSONC vs JSON
Strict JSON is deliberately minimal: double-quoted keys and strings, no comments, no trailing commas. JSONC (JSON with comments), used by VS Code and TypeScript config files, adds // and /* */ comments and usually trailing commas. JSON5 goes further, allowing unquoted keys, single-quoted strings, hexadecimal numbers such as 0x1F90, leading or trailing decimal points (.5), explicit + signs, Infinity and NaN, and strings continued across lines with a backslash. These make config files pleasant to edit, but many tools, including JSON.parse, jq, most APIs and many languages' standard libraries, only accept strict JSON. This converter parses the full JSON5 grammar, drops comments and writes standard JSON. Infinity and NaN have no JSON equivalent, so they become null with a warning. Honest limits: comments can't survive the conversion, and JSON5 โ JSON โ JSON5 loses them. Very large files are fine but slower in the browser. The JSON formatter, YAML to JSON and TOML to JSON are related, and What JSON is, and where it trips people up explains JSON.
Frequently asked questions
What is JSON5?
A superset of JSON that allows comments, trailing commas, unquoted keys, single quotes, hex numbers and more, for human-friendly config files.
How do I remove comments from JSON?
Paste it here (JSONC or JSON5) and the output is strict JSON with comments removed.
Why does tsconfig.json have comments?
TypeScript reads it as JSONC, which allows comments and trailing commas. Standard JSON parsers don't.
Is my data uploaded?
No. Everything runs in your browser and nothing is stored or sent.