JSON5 Validator & JSON5 / JSON Converter
Read config files that allow comments and relaxed syntax and convert them to plain JSON for tools that need it.
Use the tool
Why this tool exists
The parser accepts JSON5: // and /* */ comments, trailing commas, single and double quoted strings with line continuations, unquoted identifier keys, hexadecimal and signed numbers, leading or trailing decimal points, Infinity and NaN. Errors give a line and column. The reverse mode writes JSON as JSON5 with unquoted keys where possible and your choice of quote style.
Results were compared with the json5 package on valid and invalid inputs. NaN and Infinity cannot exist in JSON and become null in the strict output.
No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.
How to use it
- Choose the direction.
- Paste JSON5 or JSON.
- Set indentation and quote style.
- Copy the result.
Frequently asked questions
What is JSON5 used for?
Human-edited configuration, such as .babelrc, tsconfig variants and tool settings.
Is tsconfig.json JSON5?
It allows comments and trailing commas like JSON5, but it is parsed by TypeScript, not as full JSON5.
Can it keep comments?
No. Comments are dropped when converting to JSON.
Is my data sent anywhere?
No. Everything is processed in your browser, and the page makes no network requests with your input.