JSON5 Validator
Validate JSON5 and re-emit it as pretty JSON
About
Validate JSON5 documents (JSON with comments, trailing commas, unquoted keys and single-quoted strings) and re-emit them as pretty-printed JSON. Useful for config files (tsconfig, eslint) and modern JSON5 configs. Runs in your browser.
Examples
Parse JSON5 with comments and trailing commas
{
// pick a theme
theme: 'dark',
features: [
'search',
'share',
],
}Valid JSON5
Keys: theme, features
Type: objectSingle-line comments, unquoted keys, single-quoted strings, and trailing commas are all valid JSON5 — the parser accepts them and reports the document structure.
Format JSON5 to standard JSON
JSON5: { a:1, b:[2,3,] }{
"a": 1,
"b": [
2,
3
]
}Converts to strict JSON by adding quotes, removing the trailing comma, and pretty-printing with the chosen indent.
About this tool
JSON5 Validator parses and formats JSON5 — a backwards-compatible superset of JSON that adds comments, trailing commas, unquoted object keys, single-quoted strings, and hexadecimal numbers. It is useful for hand-edited config files where comments and trailing commas save real editing time.
The tool validates that the document is well-formed, displays the parsed structure, and can convert JSON5 to strict JSON in one click so the data can be fed to APIs and tools that only accept vanilla JSON. Parsing and formatting run entirely in your browser; the input is never transmitted or stored.
How to use
Paste your JSON5
Drop a JSON5 document into the editor, or load a sample to see comments, trailing commas, and unquoted keys in action.
Review the result
The tool reports whether the document is valid and shows the parsed structure. Any parse error is shown with its line and column.
Convert to JSON
Click Format to pretty-print, or Convert to JSON to produce a strict, double-quoted JSON document you can send to strict consumers.
Use cases
Writing human-friendly config files
Use JSON5 for hand-edited config files (tool configs, fixture data, design tokens) when comments and trailing commas save real editing time.
Validating pre-commit JSON5
Lint your JSON5 config before committing so a stray syntax error doesn't surface at runtime.
Bridging JSON5 to strict consumers
Convert relaxed JSON5 to standard JSON before feeding it to an API or a library that doesn't accept JSON5.
Common mistakes
Mistake:Assuming JSON5 is a JSON superset across all libraries.
Fix:Most JSON5 features are supported by the standard library, but some edge cases (mixed hex literals, extended strings) may differ. Validate before relying on a less-common feature.
Mistake:Shipping JSON5 to a strict consumer.
Fix:Many APIs and tools only accept strict JSON. Run the conversion step before sending the data anywhere.
Mistake:Forgetting that quoted and unquoted keys are not interchangeable in tooling.
Fix:Unquoted keys must be valid identifiers. A key like 'first-name' has to be quoted; an unquoted 'first-name' is a parse error.
Frequently asked questions
Related guides
References & standards
Related tools
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV Data Viewer
Paste CSV and browse rows in a sortable table with delimiter detection
CSV to Chart
Paste or upload CSV data and generate bar, line, pie, or doughnut charts. Export as PNG.
CSV to JSON Converter
Paste CSV data and convert it to pretty-printed JSON instantly — supports custom delimiters, header row toggling, and value trimming.
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV