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
- 1Paste your JSON5 (JSON with comments/trailing commas)
- 2Click Process
- 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
HTML Prettifier
Reformat HTML with proper nested indentation based on actual tag depth, handling void elements like <br> and <img> correctly.
CSS Prettifier
Reformat minified or messy CSS with a newline after each rule, selector, and declaration for readability.
SCSS Formatter
Clean up whitespace and blank lines in SCSS/Sass code — a light touch-up, not a full SCSS-aware reformatter.
LESS Formatter
Clean up whitespace and blank lines in LESS stylesheet code — a light touch-up, not a full LESS-aware reformatter.