var obj = JSON.parse(string);

Where string is your json string.

Answer from Kshitij on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › JSON › stringify
JSON.stringify() - JavaScript | MDN
The JSON.stringify() static method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › JSON › parse
JSON.parse() - JavaScript | MDN
The JSON.parse() static method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-string-to-json-in-javascript
How to Convert String to JSON in JavaScript? - GeeksforGeeks
August 5, 2025 - In this approach, we are using ... representing the parsed JSON data. ... Example: The below code provides the implementation to convert string to JSON using eval()....
🌐
W3Schools
w3schools.com › js › js_json_parse.asp
JSON.parse()
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference ... A common use of JSON is to exchange data to/from a web server. When receiving data from a web server, the data is always a string...
🌐
ReqBin
reqbin.com › code › javascript › x1ezvres › javascript-object-to-json-example
How do I convert object to JSON in JavaScript?
You can also convert an object to a custom JSON string using the third parameter of the JSON.stringify(value, replacer, space) method. In this example, we use the "space" parameter to add break characters to the output JSON string:
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › JSON
Working with JSON - Learn web development | MDN
Note: We've made the JSON seen above available inside a variable in our JSONTest.html example (see the source code). Try loading this up and then accessing data inside the variable via your browser's JavaScript console. Above we mentioned that JSON text basically looks like a JavaScript object inside a string. We can also convert arrays to/from JSON.
🌐
W3Schools
w3schools.com › js › js_json_stringify.asp
JSON.stringify()
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference ... A common use of JSON is to exchange data to/from a web server. When sending data to a web server, the data has to be a string...
🌐
Tutorial Republic
tutorialrepublic.com › faq › how-to-convert-js-object-to-json-string.php
How to Convert JS Object to JSON String
Let's take a look at the following example to see how this basically works: ... <script> // Sample JS object var obj = {name: "Martin", age: 30, country: "United States"}; // Converting JS object to JSON string var json = JSON.stringify(obj); ...
🌐
ReqBin
reqbin.com › code › javascript › wqoreoyp › javascript-json-stringify-example
How to stringify a JavaScript object to JSON string?
The third optional parameter controls the spacing in the generated JSON string. In this JavaScript JSON Stringify example, we use the JSON.stringify() method to convert a JavaScript object to a JSON string.
🌐
Pluralsight
pluralsight.com › tech insights & how-to guides › tech guides & tutorials
Convert Strings to JSON Objects in JavaScript with eval() | Pluralsight
March 31, 2025 - String data can be easily converted to JSON using the stringify() function, and also it can be done using eval(), which accepts the JavaScript expression that you will learn about in this guide.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-json-to-string-in-javascript
How to Convert JSON to string in JavaScript ? - GeeksforGeeks
July 23, 2025 - In this approach, we create a custom serializer function that allows more control over how the JSON data is converted to a string. This can include additional custom processing, such as handling special data types or applying specific transformations to the data. Example: In this example, we create a custom function that converts Date objects to ISO strings and omits the 'password' property.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-js-object-to-json-string-in-jquery-javascript
How to Convert JS Object to JSON String in JQuery/Javascript? - GeeksforGeeks
July 12, 2025 - JavaScript · // Sample JS object const geeks = { name: "Shubham", age: 21, Intern: "Geeksoforgeeks", Place: "Work from Home" }; // Converting JS object to JSON string const gfg = JSON.stringify(geeks); console.log(gfg); Output ·
🌐
Index.dev
index.dev › blog › string-to-json-object-java-javascript
String to JSON Object: A Guide for Java and Javascript Developers
This involves creating a function that will be invoked with the JSON string as the input parameter, though the function is not permanent. However, this approach is considered somewhat less safe and significantly worse in terms of speed compared to an approach based on JSON’s capabilities. parse(). Here's a basic example for illustrative purposes:
🌐
JSON Formatter
jsonformatter.org › json-stringify-online
JSON Stringify Online using JSON.Stringify()
Ad blocking? It's okay. Please share to support us: ... JSON Stringify Online helps convert string value to JSON String using JSON.Stringify().
🌐
PHPpot
phppot.com › javascript › javascript-object-to-json
Convert JavaScript Object to JSON String - PHPpot
Convert a JavaScript Object into a JSON string using the JS native method JSON.stringify.
🌐
Udacity
udacity.com › blog › 2021 › 04 › javascript-json-stringify.html
Converting Javascript Objects into Strings with JSON.stringify() | Udacity
September 27, 2022 - JSON.stringify() converts Javascript objects into JSON strings. It can manage many types of data type conversion, and you can also add special conversions.