JSON to JavaScript Object Converter
Convert JSON to JavaScript object literal syntax with unquoted keys and readable formatting.
Convert JSON to JavaScript object literals
JSON is valid JavaScript, but double-quoted keys and strict quoting are awkward when you paste data into source files. This tool emits readable object literal syntax with unquoted keys and single-quoted strings.
To go the other way, use JS Object to JSON. For typed output, try the JSON to JavaScript POJO Generator or JSON to TypeScript POJO Generator.
Frequently Asked Questions
When are object keys quoted?
Keys that are valid JavaScript identifiers stay unquoted. Keys with spaces or symbols are wrapped in single quotes.
Can I paste the output into a module?
The result is an expression. Wrap it with const data = or export it as needed for your bundler.
Does this run locally?
Yes. Conversion happens in the browser without uploading your JSON.