jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

JSON5 to JSON

JSON5 superset → strict RFC 8259 JSON · updated 28 July 2026

JSON5 relaxes JSON towards JavaScript: unquoted keys, single-quoted strings, comments, trailing commas, hex numbers, leading +. This converts it to strict JSON that any parser will accept. Input that is already valid JSON is simply reformatted.

Paste input to start.

How to convert JSON5 to JSON

  1. Paste your JSON5 into the input pane.
  2. If it is already strict JSON the tool says so and just reformats it.
  3. Otherwise the relaxed parser runs and the strict equivalent appears on the right.
  4. Choose an Indent — including Minified for the most compact form.
  5. Copy or download the result.

What JSON5 allows that JSON does not

How the conversion works

The relaxed parse uses the jsonrepair library, loaded from a CDN the first time you convert something that is not already valid JSON — so this one page needs a network connection on first use, while every other tool here works fully offline. Your data still never leaves the browser; only the library comes down the wire.

If your input only has comments and trailing commas, JSONC → JSON handles it with no library at all.

Privacy

Nothing is uploaded. The conversion runs in this tab using your own browser's JavaScript engine — no server sees your data, and the page keeps working with the network disconnected.

FAQ

Where is JSON5 used?

Configuration files where humans do the editing — some build tools, Babel configs, and a number of game and app config formats. It never became a web standard, so APIs almost never speak it.

Will it fix genuinely broken JSON too?

Often, yes — the same parser powers JSON repair, which additionally shows a change log and handles LLM output wrapped in prose. Use that page when the input is broken rather than deliberately JSON5.

Are comments preserved?

They cannot be — strict JSON has no comment syntax. If you need to keep them, keep the JSON5 file as the source of truth and generate the strict version at build time.