Developer ToolsCode FormattersFree Tool

JSON5 Formatter

Strip comments and trailing commas from JSON5 input, then pretty-print it as standard indented JSON.

How to Use JSON5 Formatter
  1. 1Paste your JSON5 (JSON with comments/trailing commas)
  2. 2Click Process
  3. 3Copy the pretty-printed standard JSON output
Frequently Asked Questions

It strips // and /* */ comments and trailing commas, then runs the result through standard JSON parsing and pretty-prints it — effectively converting JSON5 to standard JSON, not preserving it as JSON5.

No — only comments and trailing commas are stripped. Other JSON5-only syntax (unquoted object keys, single-quoted strings, hex numbers) will still cause a parse error, since the underlying parser is standard JSON.parse.

It shows 'Could not parse — check for syntax errors beyond JSON5 relaxation', meaning there's JSON5 syntax present that this tool doesn't handle.

No — the output is standard indented JSON (comments and trailing commas removed), not re-serialized as JSON5.

Related Tools

Related Articles

More from Developer Tools