JavaScript Developer Suite · free · no sign-up
JSON to JS Object
Turn JSON into a JavaScript object you can paste into your code.
JSON to JS Object
Convert JSON strings into native JavaScript Object format
JavaScript Tool
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
- Paste your code into the input box, or click Load Sample to load an example.
- Enter a Variable Name, such as configData, and choose the Variable Type: const, let, var or none.
- Press Convert to JS Object.
- 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.