onlinejsontools logo

Json stringifier

World's simplest json tool

Free online JSON stringifier. Just load your JavaScript data structure in the input form and it will automatically get stringified. There are no ads, popups or nonsense, just an awesome JSON stringifier. Load a data structure – get a JSON string. Created for developers by developers from team Browserling.
we wrote the curl cookbook!
Super exciting news – we just wrote the Curl Cookbook full of organic, nutritious, and completely irresistible curl recipes. Check it out!
Json stringifier tool What is a json stringifier?
This tool transforms the input JavaScript data into a JSON string. It works in the browser and uses the JSON.stringify() function to get the job done. This function converts elementary values (characters, strings, numbers, constants), objects, and arrays to a quoted string. It also finds all control characters in the data and replaces them with special JSON escape symbols. For example, it replaces a horizontal tab with the "\t" escape sequence, line feed with "\n", backspace with "\b", and form feed with "\f". It also adds a backslash character in front of quotation marks and other backslashes and wraps the output in double-quotes for convenient usage so that you can instantly paste it in your code.
Json stringifier examples Click to use
Pythagoras Quote
In this example, we apply the JSON.stringify() function to a text quote by Pythagoras. The quote contains various reserved JSON characters and as a result, we get escaped quotation marks \" instead of simple quotation marks, escaped newlines \n instead of regular newlines, and escaped tabs \t instead of regular tabs.
"The oldest, shortest words - "yes" and "no" - are those which require the most thought." Pythagoras
"\"The oldest, shortest\nwords - \"yes\" and \"no\" -\nare those which require\nthe most thought.\"\n\tPythagoras"
Stringify a JavaScript Loop
This example converts a simple JS loop to a JSON string. It replaces control characters with escape symbols and returns the code fragment as a single double-quoted string.
var names = ['HTML', 'CSS', 'JavaScript', "JSON"]; for (var i = 0; i < names.length; i++) { console.log("Hello, " + names[i] + "!"); }
"var names = ['HTML', 'CSS', 'JavaScript', \"JSON\"];\nfor (var i = 0; i < names.length; i++) {\n\tconsole.log(\"Hello, \" + names[i] + \"!\");\n}"
Pro tips Master online json tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinejsontools.com/stringify-json?input=%22The%20oldest%2C%20shortest%0Awords%20-%20%22yes%22%20and%20%22no%22%20-%0Aare%20those%20which%20require%0Athe%20most%20thought.%22%0A%09Pythagoras
All json tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly color code the syntax of a JSON file.
Quickly beautify a JSON data structure.
Quickly compress a JSON file.
Quickly convert JavaScript data to a JSON string.
Quickly convert a JSON string to JavaScript data.
Quickly check JSON for errors and report them.
Quickly escape special JSON characters.
Quickly unescape an escaped JSON string.
Quickly convert a JSON data structure to an XML file.
Quickly convert an XML file to a JSON data structure.
Quickly convert a JSON data structure to a YAML file.
Quickly convert YAML markup to a JSON data structure.
Quickly convert a JSON file to a TSV file.
Quickly convert TSV data to a JSON file.
Quickly convert a JSON document to a CSV document.
Quickly convert a CSV document to a JSON document.
Quickly convert JSON to a PNG, GIF, JPG or BMP image.
Quickly encode JSON to base64.
Quickly decode base64 to JSON.
Quickly convert JSON to URL-encoding.
Quickly convert URL-escaped JSON back to JSON.
Quickly convert JSON data to plain text.
Quickly edit a JSON file in a neat JSON editor in your web browser.
Coming soon These json tools are on the way
Display JSON Statistics
Display detailed information about a JSON data structure.
Flatten JSON
Extract all values or keys from a JSON object as a flat list.
Extract JSON Keys
Extract all keys from all key-value JSON pairs.
Extract JSON Values
Extract all values from all key-value JSON pairs.
Obfuscate JSON
Obfuscate a JSON data structure.
Convert JSON to a HTML
Create a HTML table from keys and values of a JSON object.
Convert JSON to Properties
Convert a JSON file to properties file.
Convert Properties to JSON
Convert properties data to JSON data.
Convert JSON to Bencode
Convert a JSON data structure to Bencode encoding.
Convert Bencode to JSON
Convert Bencode data to JSON data.
Convert JSON to BSON
Convert a JSON data structure to binary BSON data.
Convert BSON to JSON
Convert binary JSON data structure (BSON) to JSON.
Convert JSON to Message Pack
Serialize JSON data to binary MessagePack format.
Convert Message Pack to JSON
Unserialize binary MessagePack to JSON struct.
Convert JSON to a LaTeX Table
Generate a LaTeX table from a JSON object.
Truncate JSON
Loop over JSON structure and truncate all values or keys.
Find JSON Depth
Recusively find the depth of a JSON data structure
Convert JSON to Data URI
Convert a JSON data structure to a data URL.
Convert JSON to a PHP Array
Create a PHP data structure from a JSON data structure.
Convert a PHP array to JSON
Create a JSON data structure from a PHP data structure.
Compare Two JSON Files
Diff JSON files and show differences visually.
Sort JSON Object Keys
Lexicographically sort the order of JSON object keys.
Swap JSON Keys with Values
Exchange keys with values in a JSON file.
Create a Random JSON Array
Create a JSON array with random values.
Create a Random JSON Object
Create a JSON object with random keys and values.
Randomize a JSON Array
Randomly change the positions of array elements.
Randomize a JSON Object
Randomly change the order of key, value pairs.
Visualize JSON Structure
Create an abstract visualization of JSON's complexity.