Converter Tools
JSON5 to JSON Converter
Convert JSON5 and JSONC (JSON with comments) to strict JSON. Strips comments, trailing commas, single quotes, and unquoted keys in your browser.
Strict JSON output
342 charsOptions
Output indent
Infinity and NaN handling
How to use
- Paste your JSON5 or JSONC text into the input box on the left. The bundled samples cover tsconfig.json, JSON5 with unquoted keys, and JSONC with trailing commas.
- Pick the output indent: 2 spaces, 4 spaces, tab, or minified for a single-line result.
- Choose how to handle Infinity and NaN. Convert to null keeps the output valid JSON, Convert to string preserves the original intent as a label, and Treat as error refuses to convert.
- Use Copy JSON or Download .json to save the result. The Changes panel lists how many comments, trailing commas, single quotes, unquoted keys, and hex numbers were normalized.
- If the input has a syntax error, the right panel shows the precise line and column. Fix the issue and the output updates as you type.
About this tool
JSON5 to JSON Converter turns the loose, developer-friendly JSON dialects (JSON5 and JSONC) into strict RFC 8259 JSON that any parser accepts. Paste a config from tsconfig.json, VS Code settings.json, .babelrc, .eslintrc.json, devcontainer.json, GitHub Copilot settings, or any file with comments and trailing commas, and a clean strict-JSON version appears on the right. The converter recognizes the full JSON5 grammar: line comments (// ...), block comments (/* ... */), trailing commas in objects and arrays, single-quoted strings, unquoted identifier keys, hex numbers like 0xff, numbers that start or end with a decimal point (.5 and 5.), explicit + signs, Infinity, -Infinity, NaN, and the standard escape sequences plus \x hex escapes and line continuations. Non-standard numbers (Infinity, NaN) get a dedicated handler: replace them with null, replace them with their string forms ("Infinity", "NaN"), or refuse to convert. The output side shows a side-by-side strict-JSON view with copy and download controls, your chosen indent (2 spaces, 4 spaces, tab, or minified), and a Changes panel that reports how many comments, trailing commas, single-quoted strings, unquoted keys, and hex numbers were normalized. An Extracted comments panel collects every stripped comment in document order so you can save them to a separate notes file before throwing them away. Parse errors include a precise line and column so you can find broken bracket pairs and unterminated strings without scrolling. Everything runs in the browser. Your config files, secrets, and source-tree paths never leave your device. Useful for converting tsconfig to a strict JSON tooling expects, prepping a JSONC file for a parser that does not understand comments, generating clean output for an HTTP API that requires JSON, lifting a JSON5 fixture into JSON, and quickly sanity-checking a config you copy-pasted from a tutorial.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
JSON Formatter
Format, minify, and validate JSON in your browser.
Open tool
DeveloperJSON Validator
Strict JSON validation with line and column errors and human-readable hints.
Open tool
DeveloperJSON Repair
Auto-fix broken JSON: trailing commas, single quotes, unquoted keys, comments, smart quotes, and NDJSON.
Open tool
DeveloperComment Stripper
String-aware comment remover for 13 languages and formats.
Open tool
ConverterYAML to JSON Converter
Two-way YAML and JSON converter with anchors, flow, and block scalars.
Open tool
DeveloperJSON Minifier
Compact JSON with live byte savings and a JS literal copy.
Open tool