JSON5 / JSONC Formatter & Validator
Format JSON with comments, unquoted keys, single quotes, and trailing commas. Everything stays in your browser.
Ready to format. Your input stays in this browser.
No uploads, accounts, or input storage. The parser is loaded from a CDN; your JSON is processed locally and is never sent to that CDN.
Format JSON with comments without losing them
Paste your JSON5 or JSONC, choose two or four spaces, then select Format JSON5 to validate and reindent it while retaining every single-line and block comment. Original keys, string quotes, number literals, and trailing commas are kept. Comments may move onto their own lines.
Convert JSON5 or JSONC to standard JSON
Choose Convert to Standard JSON to remove comments and trailing commas, quote all property names, and produce JSON that works with JSON.parse. Both actions validate using JSON5 syntax, a superset of JSONC. Invalid input displays a parser error rather than a partial result.
Numbers and configuration files
JSON5 supports hexadecimal numbers, Infinity, and NaN. Formatting retains those literals; standard JSON export rejects Infinity and NaN instead of silently changing them to null. Parsing uses JavaScript numbers, so integers beyond the safe integer range can lose precision when converting to standard JSON. Use strings for exact large identifiers.
Duplicate object keys are retained when formatting; standard JSON conversion keeps the final value, matching the JSON5 parser. This tool checks syntax, not a JSON Schema.