WebToolsPlanet
Developer Tools

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

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What 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

1

Paste JSON5 into the input area or click "Load Sample"

2

The validator runs instantly — a green badge means valid, red means invalid

3

If invalid, the error shows the approximate line and column number

4

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.

JSON5 input
{
  // Application configuration
  name: 'MyApp',
  version: '1.0.0',
  features: [
    'auth',
    'logging',  // trailing comma OK
  ],
  debug: false,
}
Validation result
✓ Valid JSON5
Top-level type: object
Keys: 4

Privacy

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.

Frequently Asked Questions

What is JSON5?
JSON5 is a community specification that extends JSON to allow JavaScript-style comments, trailing commas, single-quoted strings, unquoted keys, hexadecimal numbers, and more. It makes JSON easier to write and maintain by hand while remaining fully backward-compatible with standard JSON.
Is standard JSON valid JSON5?
Yes. JSON5 is a strict superset of JSON, so all valid JSON is also valid JSON5. You can paste regular JSON into this validator and it will pass.
How is this different from the JSON Validator?
The JSON Validator checks strict RFC 8259 JSON syntax — no comments, no trailing commas, no single quotes. The JSON5 Validator additionally accepts the extended JSON5 features. If your input has comments or trailing commas, use the JSON5 Validator.
Is my JSON5 data sent to a server?
No. All validation runs entirely in your browser. Your data never leaves your device.
Which configuration file formats use JSON5?
tsconfig.json, jsconfig.json, .babelrc, .eslintrc, .prettierrc (in some setups), and many other JavaScript ecosystem config files use JSON5 or JSON5-compatible syntax.