JSON5 Validator
Validate JSON5 and re-emit it as pretty JSON
JSON5 Input
Output
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
References & standards
Related tools
Driver's License Generator
Generate driver's license numbers in the correct format for 21 countries and all 50 US states, plus a format and Luhn validator — test data only, runs in your browser.
Address Generator
Generate realistic addresses in the correct format for 21 countries — single-line, multi-line, JSON or HTML — plus a postcode validator. Test data only, runs in your browser.
Phone Number Generator
Generate phone numbers in the correct format per country — mobile, landline and toll-free — in international, national, raw or tel: format, plus a validator. Test data only.
XML to JSON Converter
Convert XML data to JSON format with attribute handling, configurable parsing options, and live statistics
Markdown to HTML Converter
Convert Markdown to clean HTML with GitHub-Flavored Markdown, syntax highlighting, and optional sanitization
Docker Run to Compose Converter
Convert a docker run command into a docker-compose.yml service definition with full flag support