This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

Create a JSON string from a JavaScript object.

const obj = {name: "John", age: 30, city: "New York"};

// JSON.stringify JavaScript object
const myJSON = JSON.stringify(obj);

// display JSON string
document.getElementById("demo").innerHTML = myJSON;