Skip to content

JavaScript Developer Suite · free · no sign-up

JSON to JS Object

Turn JSON into a JavaScript object you can paste into your code.

How it works Report a problem

JSON to JS Object

Convert JSON strings into native JavaScript Object format

JavaScript Tool
Source JSON
JS Object Format

                

About the JSON to JS Object

Turn JSON into a JavaScript object you can paste into your code.

How to use the JSON to JS Object

  1. Paste your code into the input box, or click Load Sample to load an example.
  2. Enter a Variable Name, such as configData, and choose the Variable Type: const, let, var or none.
  3. Press Convert to JS Object.
  4. Use Copy (or Download where shown) to keep the result. Clear empties the box.

Worked example

{"a": 1} becomes const configData = { a: 1 };.

Tips

  • Use const for values that will not be reassigned.

Frequently asked questions

Should I use const or let?
Use const unless you need to reassign the variable.