Skip to content

JavaScript Developer Suite · free · no sign-up

JS to JSON Converter

Convert a JavaScript object into strict JSON.

How it works Report a problem

JS to JSON Converter

Convert JavaScript Objects/Arrays into valid JSON strings

JavaScript Tool
JS Object/Array

About the JS to JSON Converter

Convert a JavaScript object into strict JSON.

How to use the JS to JSON Converter

  1. Paste your code into the input box, or click Load Sample to load an example.
  2. Optionally tick Strip Functions (Keep Data Only).
  3. Press Convert to JSON.
  4. 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.