Validate & Format · Runs in your browser

JSONC & JSON5 to JSON

Convert JSON with comments (tsconfig.json, VS Code settings, devcontainer.json) or JSON5 into strict JSON that any parser accepts.

JSONC / JSON5
Drop a file to load it
JSON
Waiting for input

How to use it

  1. Paste a JSONC or JSON5 file, or upload it.
  2. Choose whether to keep your formatting or re-indent the output.
  3. Copy or download the strict JSON.

JSONC

JSON with Comments allows // and /* */ comments and trailing commas. Both are removed; everything else is left as you wrote it.

JSON5

With “Allow JSON5 syntax” on, unquoted keys, single-quoted strings, hexadecimal numbers, numbers like .5, 5. and +1, and multi-line strings are converted too. Infinity and NaN have no JSON equivalent, so they become null and are listed as changes.

Why convert?

JSON.parse, most APIs and many tools reject comments. Converting lets you reuse a commented config file anywhere strict JSON is required.