JSON to JSON5
This converter turns standard JSON into JSON5, a superset that allows single quotes, trailing commas and unquoted keys, making the output read more like a hand-written JavaScript object. Quote style, trailing commas, indentation and key sorting are all configurable, and the conversion runs entirely in your browser — nothing is uploaded.
How to use it
- 1
Paste standard JSON
Drop JSON into the editor, or pick a local .json file. The data is read on your machine only.
- 2
Choose quotes and trailing commas
Use single or double quotes and decide whether to keep a trailing comma after the last item.
- 3
Set indent and sorting
Pick 2 spaces, 4 spaces or a tab, and optionally sort keys recursively.
- 4
Copy the JSON5
Copy the output into a file that supports JSON5, or switch to the reverse direction to go back to strict JSON.
Key features
Relaxed syntax
Output can use single quotes and trailing commas, so it looks closer to a hand-written JS object.
Controllable quotes and commas
Match your team convention with single or double quotes and an optional trailing comma.
Indent and sorting
Beautify the output and recursively sort keys for stable, easy-to-compare results.
Readable output
Unquoted keys and clean indentation make the result easier to read and edit by hand.
Pairs with the reverse tool
Use the JSON5 to JSON converter to parse JSON5 back into strict JSON.
Local and private
Conversion runs in a Web Worker in your browser; secrets and addresses in your config are never uploaded.
Common errors & troubleshooting
- ! Not every parser understands JSON5; convert back to strict JSON before feeding it to a program that only accepts standard JSON.
- ! Single quotes and unquoted keys are valid in JSON5, but keys containing special characters still need quoting.
- ! Trailing commas are allowed in JSON5 but not in standard JSON, so a file written with them will not parse with JSON.parse.
- ! If the source JSON is invalid, check it with the JSON validator first — the cause is usually the input, not the conversion.
Frequently asked questions
What is the difference between JSON5 and JSON?
JSON5 relaxes the rules: single-quoted strings, trailing commas, comments and hexadecimal numbers are allowed, which is easier to hand-write. Standard JSON is stricter and more portable.
Can a program read the JSON5 this tool produces?
It needs a JSON5 parser, for example a JSON5 library or a tool that supports JSON5 config. You can always convert back to standard JSON, which every parser accepts.
Will quotes be added where I need them?
String values are quoted according to your chosen style, and keys that require quoting are quoted automatically so the output stays valid JSON5.
Is my data uploaded?
No. The conversion runs locally in your browser; nothing leaves your device.
Related tools
JSON5 to JSON
Parse JSON5 — single quotes, unquoted keys, trailing commas and comments — and convert it back to strict, standards-compliant JSON.
JSON to JavaScript
Convert JSON into a JavaScript object literal with an optional const, export const, module.exports or bare-literal wrapper and a configurable variable name.
JSON Formatter
Format, beautify and validate JSON in your browser. Errors point to the exact line and column, and you can indent with 2 spaces, 4 spaces or a tab.