- Free
- No sign-up
- Works on any device
No tool matches your search.
- Free
- No sign-up
- Works on any device
Create a QR code for a link, Wi-Fi, WhatsApp, contact and more, or read one from a photo.
- Free
- No sign-up
- Works on any device
Fill in the details to see your QR code.
PNG for phones, chats and websites. SVG and PDF stay sharp at any size, which is best for printing. Tip: point your phone camera at the preview to test it.
3. Style (optional): colors, dots, logo
Choose a photo or screenshot or drag it here
Works with photos of printed codes, screenshots and image files.
Looking for QR codes…
JavaScript Object to JSON Converter
Convert a JavaScript object literal with unquoted keys, single quotes, comments and trailing commas into strict, valid JSON.
- Free
- No sign-up
- Works on any device
About JavaScript Object to JSON Converter
A JavaScript object literal is not valid JSON: keys may be unquoted, strings may use single quotes or backticks, and comments and trailing commas are allowed. This tool reads such a literal without running it, so nothing in the text can execute, and writes strict JSON with double-quoted keys. It also accepts hexadecimal numbers, line continuations and a leading const data = or export default, and reports the line and column of the first error. Pick two spaces, four spaces, tabs or a minified single line. Values that JSON cannot hold, such as undefined or NaN, are dropped or written as null with a note.
How to use JavaScript Object to JSON Converter
- Paste the object literal, or the whole const x = {...} line.
- Choose the output style: two or four spaces, tab or minified.
- Copy the JSON, or read the line and column of the first error and fix it.
Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
- Free to embed on your own website, with a ready-made code to copy.
- Available in 10 languages.
Also known as
Frequently asked questions
Does the converter use eval to read my object?
No. It has its own parser, so functions and other code in the pasted text cannot run. Anything that is not data, such as a function call, is reported as an error.
What happens to undefined and functions?
JSON has no undefined, so a property with that value is left out of objects and written as null inside arrays. Functions are not data and cause an error.
Can it read JSON5 as well?
Yes for the parts that matter in practice: unquoted keys, single-quoted strings, comments, trailing commas, hexadecimal numbers and plus signs. Output is always strict JSON.
Is JavaScript Object to JSON Converter free?
Yes. JavaScript Object to JSON Converter on Toolipedia is free to use, with no sign-up and no watermark.
Is it safe to use?
Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.
Does it work on my phone?
Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.
Do I need an account?
No. Just open the page and use the tool. There's no sign-up and no email needed.
Can I put JavaScript Object to JSON Converter on my own website?
Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.