JSON5 to JSON
Convert JSON5 or JSON with comments (JSONC) into strict JSON: strips comments and trailing commas, quotes keys and fixes single quotes. Free and private.
Runs in your browser. Nothing is uploaded.
About JSON5 to JSON
Config files such as tsconfig.json, VS Code settings and many .json5 files allow comments, trailing commas, unquoted keys and single-quoted strings. JSON.parse rejects all of them. This converter reads the relaxed syntax and writes standard JSON any parser accepts.
It also understands hexadecimal numbers, leading or trailing decimal points, Infinity and NaN placeholders and multi-line strings, following the JSON5 spec.
How to use JSON5 to JSON
- Type or paste your text into the input box. Press Sample to see an example.
- Adjust the options. The result updates as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
What is JSONC?
JSON with Comments, the format VS Code and TypeScript use for config. It's a subset of JSON5.
What happens to Infinity and NaN?
Strict JSON has no way to write them, so they become null.
Is JSON5 to JSON free and private?
Yes. JSON5 to JSON is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.