JSON Stringify
Convert any text to a properly escaped JSON string — adding surrounding quotes and escaping all special characters so the text is valid as a JSON string value.
What Does This Tool Do?
When you need to embed text inside a JSON document or API payload, the text needs to be properly escaped: double quotes inside the text get backslash-escaped, newlines become \n, tabs become \t, and the whole thing gets wrapped in double quotes. This is what JSON.stringify() does — this tool does the same thing without writing any code.
Key Features
How to Use This Tool
- Paste or type your text (can include newlines, quotes, etc.).
- Click Stringify to get the JSON-escaped version.
- Copy the output and use it as a JSON string value.
How It Works
The text is passed through JavaScript's JSON.stringify() function which handles all necessary escaping: " → \", newline → \n, tab → \t, backslash → \\, and all other control characters.
Common Use Cases
Frequently Asked Questions
Should I include the surrounding quotes?
By default yes — the output includes the surrounding double quotes, making it ready to paste as a JSON value. You can toggle this off if you only need the escaped content without quotes.
What characters are escaped?
Double quotes, backslashes, newlines (\n), carriage returns (\r), tabs (\t), and all other control characters below ASCII 32 are escaped.
Related Tools
Link to This Tool
Copy and paste the code below to link to this tool from your website: