JavaScript Developer Suite · free · no sign-up
JS to JSON Converter
Convert a JavaScript object into strict JSON.
JS to JSON Converter
Convert JavaScript Objects/Arrays into valid JSON strings
JavaScript Tool
About the JS to JSON Converter
Convert a JavaScript object into strict JSON.
How to use the JS to JSON Converter
- Paste your code into the input box, or click Load Sample to load an example.
- Optionally tick Strip Functions (Keep Data Only).
- Press Convert to JSON.
- Use Copy (or Download where shown) to keep the result. Clear empties the box.
Worked example
{ name: 'Dev', id: 101 } becomes {"name": "Dev", "id": 101}.
Tips
- JSON requires double quotes around keys and strings.
- Functions cannot be stored in JSON, so they must be stripped.
Frequently asked questions
What is the difference between a JS object and JSON?
JSON is a strict text format: keys and strings need double quotes and there are no functions or comments.