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

JSON to JSON5

Convert strict JSON into JSON5 — a superset that allows unquoted keys, single-quoted strings, trailing commas, and comments. Output uses the official json5 library's stringify with 2-space indent.

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

JSON in, JSON5 out

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

JSON input
{
  "name": "hcodx",
  "version": "1.0.0",
  "tags": ["dev", "tools"],
  "config": { "debug": true, "timeout": 5000 }
}
JSON5 output
{
  "name": "hcodx",
  "version": "1.0.0",
  "tags": [
    "dev",
    "tools"
  ],
  "config": {
    "debug": true,
    "timeout": 5000
  }
}
Use cases

What you'll use this for

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

API integration

Generate JSON5 config files from JSON-based service responses.

Config migration

Move from JSON to a more comment-friendly JSON5 for human editing.

Data import

Hand-edit JSON5 configs, then strip comments for downstream JSON consumers.

CI pipelines

Author tool configs in JSON5, serialize to strict JSON during builds.

Step by step

How to convert JSON to JSON5

1

Paste your JSON

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.json5.

4

Reverse if needed

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

FAQ

Frequently asked questions

Yes. JSON5 supports the same types as JSON, plus extras like Infinity, NaN, and hexadecimal numbers.

They're emitted verbatim with the same nesting structure as the JSON input.

Yes. No signup, no limits.

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

Use the JSON5 to JSON converter for strict JSON output.

About

About JSON and JSON5

JSON5 extends JSON with developer-friendly syntax: comments, trailing commas, unquoted identifier keys, single-quoted strings, and more lenient numbers. It's used by tools like Babel, Webpack, and many editors' config files.

Common pitfalls

  • JSON5 isn't a network format — it's for human-edited config.
  • Most JSON parsers reject JSON5 — use the json5 library at runtime.
  • Conversions are lossless from JSON to JSON5; the reverse may drop comments.
Related

Related tools