var data = { name: "himanshu", github: "himanshurajora" } var strData = JSON.stringify(data) // json stringify by default gives us double quotes // you can setup the same format as json itself var strData = JSON.stringify(data, null, 4)