What JSON string escaping does
Inside JSON, a string is wrapped in double quotes, and certain characters must be escaped so the document stays valid: a double quote becomes \", a backslash becomes \\, and control characters like newline and tab become \n and \t. Escaping builds that literal for you from raw text; unescaping does the reverse, giving back the original string with real line breaks and quotes.
How to use this tool
- Encode takes plain text and returns a quoted, fully escaped JSON string you can paste straight into a JSON file or request body.
- Decode takes a JSON string literal (with the surrounding quotes) and returns the text it represents.
Because it uses the same rules as a real JSON parser, the output is always valid and round-trips exactly.
Why you need it
Any time you embed text inside JSON by hand — a log line with quotes in it, a multi-line message, a Windows path full of backslashes — unescaped characters will break the document. Escaping first guarantees the value is well-formed. Unescaping is just as useful for reading a value that has been escaped two or three layers deep.
Examples
Frequently asked questions
What characters must be escaped in a JSON string?
Should the input include the surrounding quotes when decoding?
Does it handle Unicode?
Is my data sent anywhere?
Related tools
Every tool on encoder.website converts your text and hands the result straight back — it is never stored. Pick another tool from the sidebar any time.