You need to JSON.parse() your valid JSON string.

var str = '{"hello":"world"}';
try {
  var obj = JSON.parse(str); // this is how you parse a string into JSON 
  document.body.innerHTML += obj.hello;
} catch (ex) {
  console.error(ex);
}

Answer from Chase Florell on Stack Overflow
🌐
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().
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › data types
JSON methods, toJSON
Initially it was made for JavaScript, but many other languages have libraries to handle it as well. So it’s easy to use JSON for data exchange when the client uses JavaScript and the server is written on Ruby/PHP/Java/Whatever. ... JSON.stringify to convert objects into JSON.
🌐
W3Schools
w3schools.com › js › js_json_stringify.asp
JSON.stringify()
Use the JavaScript function JSON.stringify() to convert it into a string.
🌐
JSON Formatter
jsonformatter.org › string-to-json-converter
String to JSON Converter online to convert JSON string to JSON
String to JSON Converter online converts JSON String to JSON data by removing escapped data.
🌐
V8
v8.dev › blog › json-stringify
How we made JSON.stringify more than twice as fast · V8
At the end, the final result is constructed by simply concatenating the output from the initial one-byte stringifier with the output from the two-byte one. This strategy ensures we stay on a highly-optimized path for the common case, while the transition to handling two-byte characters is lightweight and efficient. Any string in JavaScript can contain characters that require escaping when serializing to JSON (e.g.
🌐
DigitalOcean
digitalocean.com › community › tutorials › js-json-parse-stringify
How To Use JSON.parse() and JSON.stringify() | DigitalOcean
November 24, 2021 - The values have been transformed to uppercase characters. JSON.stringify() takes a JavaScript object and transforms it into a JSON string.
Find elsewhere
🌐
Udacity
udacity.com › blog › 2021 › 04 › javascript-json-stringify.html
Converting Javascript Objects into Strings with JSON.stringify() | Udacity
September 27, 2022 - JSON.stringify() requires one parameter: the Javascript object to be converted into a JSON string. Javascript object literals can be cumbersome to type, so it is often easier and more readable to pass them as a variable.
🌐
4D
developer.4d.com › 4d language › commands by theme › json › json stringify
JSON Stringify | 4D Docs
The JSON Stringify command converts the value parameter into a JSON string. This command performs the opposite action of the JSON Parse command. Pass the data to be serialized in value.
🌐
Built In
builtin.com › software-engineering-perspectives › json-stringify
How to Use JSON.stringify() and JSON.parse() in JavaScript | Built In
Here's how to use them. Written by Dr. Derek Austin ... Summary: JSON.stringify() converts a JavaScript object into a JSON string, and JSON.parse() reverses the process. These methods are often used together to handle JSON data, but they don’t ...
🌐
Testmu
testmu.ai › home › free tools › json stringify online
JSON Stringify Online | Free online tool to Stringify JSON
The text stringifier() function ... data storage, and communication. JSON.stringify() is a powerful method in JavaScript used to convert a JavaScript object into a JSON string....
🌐
Medium
medium.com › @debbie.obrien › json-parse-v-json-stringify-4b9d104c78d0
JSON Parse v JSON Stringify. I always get confused between the JSON… | by Debbie O'Brien | Medium
May 28, 2018 - JSON.stringify() converts a JavaScript object to a JSON string. When sending data to a web server, the data has to be a string.
Top answer
1 of 3
61

From the fine manual:

toJSON behavior

If an object being stringified has a property named toJSON whose value is a function, then the toJSON method customizes JSON stringification behavior: instead of the object being serialized, the value returned by the toJSON method when called will be serialized.

This is why Backbone uses the toJSON method for serialization and given a model instance called m, you can say things like:

var string = JSON.stringify(m);

and get just the attributes out of m rather than a bunch of noise that your server won't care about.

That said, the main difference is that toJSON produces a value (a number, boolean, object, ...) that gets converted to a JSON string whereas JSON.stringify always produces a string.

The default Backbone toJSON is simply this (for models):

return _.clone(this.attributes);

so m.toJSON() gives you a shallow copy of the model's attributes. If there are arrays or objects as attribute values then you will end unexpected reference sharing. Note that Backbone.Model#clone also suffers from this problem.

If you want to safely clone a model's data then you could send it through JSON.stringify and then JSON.parse to get a deep copy:

var data         = JSON.parse(JSON.stringify(model_instance));
var cloned_model = new M(data);

where model_instance is your instance of the Backbone model M.

2 of 3
16
  • JSON.stringify() - Any valid JSON representation value can be stringified.

    The JSON.stringify(..) utility will automatically omit undefined, function, and symbol values when it comes across them. If such a value is found in an array, that value is replaced by null (so that the array position information isn't altered). If found as a property of an object, that property will simply be excluded.

    JSON stringification has the special behavior that if an object value has a toJSON() method defined, this method will be called first to get a value to use for serialization.

  • toJSON() - to a valid JSON value suitable for stringification.

    One example, JSON.stringify() an object with circular reference in it, an error will be thrown. toJSON() can fix it as following.

    var o = { };
    var a = {
        b: 32,
        c: o
    };
    
    // circular reference
    o.d = a;
    
    // JSON.stringify( a ); // an error caused by circular reference
    
    // define toJSON method
    a.toJSON = function() {
         return { b: this.b };
    };
    
    JSON.stringify( a ); // "{"b":32}"
    
🌐
RestfulAPI
restfulapi.net › home › json › json stringify()
JSON stringify()
November 3, 2023 - The JSON.stringify() function, as name suggests, converts a JavaScript value to a serialized JSON string. JSON.stringify() can optionally use a replacer function to replace values using custom logic.
🌐
Online String Tools
onlinestringtools.com › json-parse-string
JSON Unstringify a String – Online String Tools
Quickly convert a string to a JSON string. ... Quickly convert a JSON stringified string to a regular string.
🌐
Dadroit
dadroit.com › string-to-json
Online String to JSON Converter
To convert String to JSON, visit the tool address, input your String data —or load your String file— and the tool will display the corresponding JSON output in real time.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-json-stringify-method
JavaScript JSON stringify() Method - GeeksforGeeks
July 11, 2025 - The JSON.stringify() method in JavaScript is used to convert JavaScript objects into a JSON string.
🌐
Online Tools
onlinetools.com › json › stringify-json
Stringify JSON – Online JSON Tools
This tool transforms the input JavaScript data into a JSON string. For example, it can convert a JavaScript expression, a JSON object, a string with special characters, and a larger text with newlines into a compactly stringified JSON string.
🌐
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.