JSON5⇄JSON
keys 0
lines 0
JSON5
drop a .json5 file here0 bytes
JSON5
JSON
JSON
drop a .json file here0 bytes
What is JSON5, and why convert it to JSON?
JSON5 is a relaxed superset of standard JSON aimed at humans writing config files by hand. It allows things strict JSON doesn't: // comments, trailing commas after the last item in an array or object, unquoted object keys, and single-quoted strings. It's the format behind config files for tools like Babel and many editor settings files.
Strict JSON has none of that flexibility — comments and trailing commas are syntax errors — but it's the format nearly every API, log pipeline, and data store actually requires. This converter strips the relaxed syntax down to valid JSON, or takes plain JSON and reformats it with JSON5's more human-friendly conventions.
Frequently asked questions
What happens to comments when converting JSON5 to JSON?
They're removed. Standard JSON has no concept of comments, so there's no equivalent place to put them — this is an inherent, one-way loss when converting in this direction, not a bug.
Are trailing commas and unquoted keys really valid JSON5?
Yes, both are part of the JSON5 specification, along with single-quoted strings and a few other relaxations. This tool uses the official
json5 library to parse and generate them correctly.Does converting JSON to JSON5 unquote all the keys?
It unquotes keys where it's safe to do so — valid identifier-style names like
name or userId. Keys with spaces, hyphens, or other characters that wouldn't be valid unquoted stay quoted, since that's the only way to represent them.Does this converter need an internet connection?
The JSON5 parser and generator are loaded from a CDN the first time you use this module, in either direction. Once loaded, all the actual conversion still happens locally in your browser — nothing you paste is ever sent anywhere.