HCODX/JSON5 to JSON
100% browser-based · UTF-8 safe · No upload

JSON5 to JSON

Convert JSON5 into strict JSON. Comments are dropped, single-quoted strings become double-quoted, trailing commas are removed, unquoted keys are quoted. Uses the official json5 reference parser.

JSON5 input
JSON output
Options
Reverse (JSON → JSON5)
Input size
0 B
Output size
0 B
Output lines
0
Status
Ready
Example

JSON5 in, JSON out

See exactly how JSON5 maps onto JSON — the converter on this page produces output identical to the example below.

JSON5 input
{
  // JSON5 sample
  name: 'hcodx',
  tags: ['dev', 'tools',],
  version: 1.0,
  config: { debug: true, },
}
JSON output
{
  "name": "hcodx",
  "tags": ["dev", "tools"],
  "version": 1,
  "config": { "debug": true }
}
Use cases

What you'll use this for

Converting JSON5 to JSON is a daily task in API integration, config management, and data pipelines.

API integration

Strip comments before sending JSON5 configs to APIs that only accept strict JSON.

Config migration

Convert developer-friendly JSON5 to wire-format JSON for production.

Data import

Normalize hand-edited JSON5 fixtures into strict JSON for parsers that don't support comments.

CI pipelines

Author readable JSON5 in repo, emit minimal JSON for deployment.

Step by step

How to convert JSON5 to JSON

1

Paste your JSON5

Drop it into the left editor. The sample is loaded by default — clear it or click the wand to reload.

2

Click Convert

Or leave auto-convert on for live updates. Conversion runs entirely in your browser — no upload.

3

Copy or download

Copy to clipboard or save the output as data.json.

4

Reverse if needed

Jump to the JSON to JSON5 converter for a round-trip check.

FAQ

Frequently asked questions

Numbers, strings, booleans, null, arrays, and objects all round-trip cleanly. JSON5's Infinity/NaN can't be represented in JSON.

They're preserved verbatim — the converter only changes syntax, not structure.

Yes. No signup, no limits.

You'll see a clear parse error in the output panel.

Use the JSON to JSON5 converter for the opposite direction.

About

About JSON5 and JSON

JSON5 is a superset of JSON that adds developer ergonomics: comments, trailing commas, unquoted keys, single quotes, hex/Infinity/NaN numbers, and multiline strings. Strict JSON (defined by RFC 8259) doesn't support any of those.

Common pitfalls

  • Comments are silently dropped — JSON has no comment syntax.
  • Infinity and NaN can't be represented and will raise an error.
  • The reverse direction is lossless from the JSON5 grammar perspective.
Related

Related tools