JSON5 to JSON Converter & Validator

Paste JSON5 or JSON with comments (JSONC, like tsconfig.json or VS Code settings) and get strict, valid JSON. Comments, trailing commas, single-quoted strings, unquoted keys, hex numbers and Infinity are handled — with the exact line and column of any error.

Runs in your browserUpdated
Special numbers

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the JSON5 to JSON Converter

  1. Paste JSON5, JSONC or any “relaxed” JSON on the left.
  2. Strict JSON appears on the right; errors show the exact line and column.
  3. Choose the indent, and how Infinity and NaN (not allowed in JSON) are written.
  4. Copy the JSON.

JSON5 and JSONC vs. JSON

Allowed in JSON5ExampleStrict JSON
Comments// note, /* … */removed
Trailing commas[1, 2,][1, 2]
Unquoted keys{ name: "x" }{ "name": "x" }
Single quotes'text'"text"
Hex, leading dot, plus sign0xFF, .5, +1255, 0.5, 1
Infinity, NaNInfinitynull (or a string)
Multi-line stringsbackslash at line endone line

JSONC (“JSON with comments”) is the format of tsconfig.json, VS Code and many editor settings: JSON plus comments and, often, trailing commas. JSON5 goes further. Both are great for hand-written config — but APIs, databases and JSON.parse need strict JSON.

Next steps: format and validate JSON, or convert it to YAML or TOML.

Also searched as: json5 to json, jsonc to json, json with comments, json5 parser, json5 validator, remove comments from json, trailing comma json, tsconfig to json.

Tools that pair well with the JSON5 to JSON Converter

  • JSON Validator — Paste JSON to check whether it is valid.
  • JSONL Converter — Turn JSON Lines (JSONL / NDJSON — one JSON object per line, as used by logs, BigQuery, OpenAI fine-tuning and data exports) into a JSON array, or an array back into JSONL.
  • JSON Schema to TypeScript — Paste a JSON Schema (draft-07 or 2020-12) and get TypeScript interfaces — required and optional properties, enums as union types, oneOf/anyOf as unions, allOf as intersections, $ref definitions as named types and descriptions as JSDoc comments.
  • JSON Minifier — Remove all unnecessary whitespace from JSON, validate it at the same time and see exactly how many bytes you save — before and after gzip.

Frequently asked questions

How do I remove comments from JSON?
Paste the JSON with comments here — the output is the same data as strict JSON, with every // and /* */ comment and trailing comma removed.
What is the difference between JSON5 and JSONC?
JSONC is JSON plus comments (and usually trailing commas), used by tsconfig.json and VS Code. JSON5 also allows unquoted keys, single quotes, hex numbers, Infinity and more.
What happens to Infinity and NaN?
Strict JSON has no Infinity or NaN, so they become null (like JSON.stringify does) or, if you choose, strings.
Is my data uploaded?
No. Parsing happens entirely in your browser.
Can I install JSON5 to JSON Converter as a web app and use it offline?
Yes. JSON5 to JSON Converter is an installable web app (PWA) — installed from your browser, not downloaded from an app store. Click Install app at the top of this page in Chrome or Edge (Windows, macOS, Linux, ChromeOS) or on Android, use Share → Add to Home Screen on iPhone and iPad, or File → Add to Dock in Safari 17+ on a Mac. It then opens in its own window with its own icon, and because it runs entirely in your browser it keeps working offline. Firefox on desktop can’t install web apps. How installing works.

Related tools