Comments are accepted
Single-line // and multi-line /* */ are dropped; only data remains. Keep important notes in a README. Do not expect comments to survive in standard JSON.
Fits the step from “config people read” to “JSON programs parse.”
You can also load data via #data={"name":"Ada"} or #url=... It is cleared from the address bar after it is read.
JSON5 is a looser superset for writing config: comments, trailing commas, single quotes, and unquoted keys are allowed. This page parses it and outputs standard JSON for APIs and other tools. Content copied from VS Code, webpack config, or a handwritten JS object often cannot be passed straight to JSON.parse . Run it through this page first.
Single-line // and multi-line /* */ are dropped; only data remains. Keep important notes in a README. Do not expect comments to survive in standard JSON.
Fits the step from “config people read” to “JSON programs parse.”
A comma after the last item in an object or array no longer fails parse. That is the most common error when copying a JS / TS object literal.
Converted output does not keep trailing commas, which matches RFC 8259.
The result can be used by JSON.parse and most backends directly. Keys get double quotes; single-quoted strings become double-quoted.
After conversion you can format, validate, or generate a Schema.
{
// 功能开关
name: 'json5',
enabled: true,
tags: ['a', 'b',],
}
{
"name": "json5",
"enabled": true,
"tags": [
"a",
"b"
]
}
No. Standard JSON has no comments, so they are discarded after conversion.
JSONC usually only adds comments. JSON5 also relaxes keys, quotes, and number syntax. This page parses JSON5 rules.
JSON5 allows those number forms. After conversion to standard JSON, whether downstream accepts them depends on the parser—spot-check.
No. It only parses data literals. It does not run functions or evaluate expressions.
JSON.parse can parse. JSON5 is for “humans write it, then normalize before machines read it.” Public APIs should still accept only standard JSON so clients do not each invent a superset.