JSON and JavaScript object literals look similar but follow different rules: JSON demands double-quoted keys and forbids comments and trailing commas, while idiomatic JavaScript prefers bare identifiers for keys. This tool rewrites JSON as a clean object literal, ready to paste into a .js or .ts source file without tripping your linter.
Front-end developers use it to turn API responses into mock data for tests and Storybook stories, and to convert downloaded fixtures into constants modules. Rather than hand-editing hundreds of quoted keys, you paste once and get a literal that reads like it was written in the codebase.
This page performs the rewrite with nothing but local browser JavaScript — fitting, given what it produces. Fixtures and API data you convert are never sent anywhere, logged, or retained after you close the tab.
Keys that are valid JavaScript identifiers lose their surrounding quotes, and the whole document is reformatted as an expression you can assign to a variable. The values and structure remain exactly the same.
A JSON document is essentially a valid JavaScript expression, so pasting it raw usually works. The converted literal, however, matches common lint rules and code style, making it far more pleasant to keep in a source file long term.
Keys that are not valid identifiers, such as ones with spaces, dashes, or leading digits, keep their quotes. That preserves correctness while everything else is cleaned up.