What the JSON5 Validator does
The JSON5 Validator checks JSON5 syntax with the reference JSON5 library and reports the line and column of any error. JSON5 is the relaxed form of JSON used in some configuration files, where comments, trailing commas and unquoted keys are allowed.
JSON5 Validator examples
The built-in sample
Input
{"name":"Ada Lovelace","active":true,"tags":["math","code"],"address":{"city":"London"}}Output
Valid JSON5.This is the input that the Load sample button fills in.
Syntax that JSON5 accepts and JSON does not
Input
{a: 1, b: +Infinity, c: 'it\'s', /* note */ d: [1,],}Output
Valid JSON5.Unquoted keys, a leading plus sign, Infinity, single-quoted strings, block comments and trailing commas are all valid JSON5.
Each output was produced by running this tool on the input above it.
How it works
The JSON5 library parses the input, accepting comments, trailing commas, single-quoted strings, unquoted keys, hexadecimal numbers and the other JSON5 extensions. If parsing succeeds the tool answers "Valid JSON5."; otherwise it shows the library's message.
Details and limits
- Errors are reported by the JSON5 library as
JSON5: invalid character 'x' at line:column. - JSON5 is still stricter than a JavaScript object literal:
undefined, unquoted string values, template literals and function calls are all rejected. - Every valid JSON document is also valid JSON5, so this validator cannot tell you whether a file is strict JSON. Use the JSON Validator for that.
- Input that is not valid JSON stops the tool, and the status line shows where the problem is. The JSON Validator page lists the usual causes.
Questions
Is my data uploaded when I use JSON5 Validator?
No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.
What does JSON5 Validator do?
The JSON5 Validator checks JSON5 syntax with the reference JSON5 library and reports the line and column of any error. JSON5 is the relaxed form of JSON used in some configuration files, where comments, trailing commas and unquoted keys are allowed.
How does JSON5 Validator work?
The JSON5 library parses the input, accepting comments, trailing commas, single-quoted strings, unquoted keys, hexadecimal numbers and the other JSON5 extensions. If parsing succeeds the tool answers "Valid JSON5."; otherwise it shows the library's message.
Are there any limits I should know about?
Errors are reported by the JSON5 library as JSON5: invalid character 'x' at line:column. JSON5 is still stricter than a JavaScript object literal: undefined, unquoted string values, template literals and function calls are all rejected.
Is there a size limit?
There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.
Does it work on phones, and is it free?
Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.