JSON Stringify & Escape
This JSON stringify tool converts a document into the single-line, escaped string literal you can paste into source code, a database column or another JSON field: double quotes become escaped quotes, backslashes are doubled, line breaks become \n, and other control characters become \u escapes. Valid JSON is minified before escaping so the result is as compact as possible. The same tool works in reverse — paste an escaped literal and get the readable text back, automatically formatted when it turns out to be JSON. Everything is escaped locally in your browser.
How it works
Stringify turns a document into the single-line string literal you can paste into source code, a database column or another JSON field: double quotes become \", backslashes become \\, and line breaks become \n. Unescape does the reverse, turning a pasted literal back into readable text.
Everything is escaped locally in your browser — no upload, no server round trip.
0 characters in · 0 characters out
How to stringify JSON online
- Keep the direction on Stringify → escaped.
- Paste the JSON or plain text you want to embed.
- The escaped, single-line string literal appears on the right, ready to copy.
- To go the other way, switch to Escaped → unescape and paste the literal instead.
What gets escaped
- Double quotes become
\"so they do not close the string early. - Backslashes become
\\. - Line breaks become
\n, tabs become\t, carriage returns become\r. - Other control characters become
\u00XXescapes.
Common use cases
- Embedding a JSON payload inside another JSON field, such as a webhook body or a job argument.
- Pasting a document into a string constant in source code without breaking the quotes.
- Storing structured data in a database column that only accepts text.
- Reading an escaped blob out of a log line and turning it back into formatted JSON.
Frequently asked questions
What does stringifying JSON do?
It turns a document into a single-line string literal with every special character escaped, so the whole thing can live inside another string — a code constant, a text database column, or a field in a larger JSON payload — without breaking its quotes.
Which characters get escaped?
Double quotes become an escaped quote, backslashes are doubled, line breaks become \n, tabs become \t, carriage returns become \r, and any remaining control characters become \u00XX escapes.
How do I unescape a JSON string?
Switch the direction to unescape and paste the literal. Surrounding quotes are optional — the tool accepts the literal with or without them and returns the original text, formatted automatically when the result is valid JSON.
Should I keep the surrounding quotes?
Keep them when you are pasting the result somewhere that expects a complete JSON string value. Turn them off when you are pasting into a place that already supplies its own quotes, such as between the quote marks of an existing string in code.
Why is my JSON minified before escaping?
Indentation and line breaks would each become an escape sequence, making the literal much longer for no benefit. Minifying first keeps the escaped string compact; turn the option off if you need the original whitespace preserved.
Is my data sent anywhere when escaping?
No. Escaping and unescaping happen entirely in your browser, so nothing you paste is uploaded or logged.
Related tools
JSON Formatter & Beautifier
This JSON formatter beautifies minified or messy JSON online with clean indentation, line numbers, and code folding.
JSON Minifier
This JSON minifier strips whitespace and line breaks to shrink payload size for APIs and config files.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to plain text, entirely in your browser, with full UTF-8 support.