This tool escapes your text into a valid JSON string literal, handling quotes, backslashes and newlines — all in your browser.
How to use it
- Paste raw text with quotes or newlines.
- It is escaped into a JSON string.
- Copy the JSON-safe literal.
About JSON String Escaper
Embedding arbitrary text into JSON requires escaping quotes, backslashes, newlines and control characters, which is fiddly by hand. This tool wraps your input in a correctly escaped JSON string literal so you can paste it straight into a config or payload. It runs entirely in your browser and never sends your text anywhere.
FAQ
What characters get escaped?
Double quotes, backslashes, newlines, tabs and other control characters are escaped per the JSON spec.
Does it add the surrounding quotes?
Yes — the output is a complete JSON string literal including the wrapping double quotes.
How do I reverse it?
Use the JSON string unescaper tool to turn a JSON literal back into raw text.