JSON5 Validator
Paste JSON5 and instantly validate it. JSON5 extends JSON to allow comments, trailing commas, single-quoted strings, and unquoted keys — making it friendlier for hand-authored config files.
Last updated: May 28, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON5 Validator?
JSON5 is a superset of JSON that removes many of the strict formatting requirements that make JSON awkward to write by hand. It allows:
- **Single-line comments**: `// like this` - **Multi-line comments**: `/* like this */` - **Trailing commas** in objects and arrays - **Single-quoted strings**: `'hello'` - **Unquoted object keys** that are valid JavaScript identifiers - **Hexadecimal numbers**: `0xFF` - **Infinity and NaN** as numeric values - **Leading/trailing decimal points**: `.5`, `5.`
JSON5 is commonly used in configuration files like `tsconfig.json`, `.eslintrc`, and `babel.config.js`. This validator checks whether your text conforms to JSON5 syntax and reports errors with line and column numbers.
How to Use JSON5 Validator
Paste JSON5 into the input area or click "Load Sample"
The validator runs instantly — a green badge means valid, red means invalid
If invalid, the error shows the approximate line and column number
If valid, the stats bar shows the top-level type and estimated key count
Common Use Cases
- Validating tsconfig.json or jsconfig.json files that use comments and trailing commas.
- Checking .eslintrc or .babelrc config files for JSON5 syntax errors.
- Validating hand-authored JSON5 config before deploying an application.
- Debugging why a JSON5 file fails to parse in a build tool.
- Learning the JSON5 spec by testing examples interactively.
Example Input and Output
A JSON5 config with comments, trailing commas, and unquoted keys — all valid JSON5.
{
// Application configuration
name: 'MyApp',
version: '1.0.0',
features: [
'auth',
'logging', // trailing comma OK
],
debug: false,
}✓ Valid JSON5
Top-level type: object
Keys: 4Privacy
All validation runs in your browser. No data is uploaded to any server.
Note
This validator uses a lightweight hand-rolled JSON5 parser without external dependencies. It covers the most common JSON5 features but may not handle all edge cases of the full JSON5 specification.

