Json Escape
Escape or unescape any string for use inside JSON, safely handling quotes, backslashes, newlines and special characters. No signup. Ideal for developers building JSON by hand.
Result
| Result |
|---|
Share on Social Media:
This JSON escape tool converts any string into a safely escaped JSON string, and unescapes escaped strings back to plain text, directly in your browser. Paste your text, escape or unescape it, and copy the result. No account, no install, so developers embedding text in JSON can handle quotes, backslashes and special characters correctly on any device.
How to Escape a String for JSON Step by Step
- Paste your text. Drop the string you want to escape into the input box. It might contain quotes, backslashes, newlines or other characters that need special handling inside JSON.
- Choose escape or unescape. Select escape to make a plain string safe for JSON, or unescape to convert an already escaped JSON string back into readable plain text.
- Process the string. The tool converts the special characters, so double quotes become escaped quotes, backslashes are doubled, and newlines and tabs become their escape sequences.
- Check the result. Confirm the output is correctly escaped or unescaped. An escaped string can be safely pasted inside JSON quotes without breaking the structure.
- Copy the result. Copy the escaped string into your JSON, or the unescaped string into wherever you need the readable text, ready to use without syntax errors.

What JSON Escaping Is and Why It Is Necessary
JSON strings are wrapped in double quotes, which creates an immediate problem: what if the text itself contains a double quote? Without a rule, that quote would prematurely end the string and break the JSON. Escaping solves this by placing a backslash before the special character, telling the parser to treat it as literal text rather than JSON syntax. This is why an escaped quote appears as a backslash followed by a quote inside JSON.
Several characters require escaping in JSON. The double quote and the backslash itself are the most common, since both have special meaning. Control characters like newline and tab cannot appear literally in a JSON string and must be written as escape sequences, a backslash followed by n for a newline or t for a tab. Getting all of these right by hand across a long string is tedious and error prone, which is exactly what an escape tool automates.
Escaping and unescaping are exact inverses. Escaping takes readable text and makes it safe to embed in JSON by adding the necessary backslashes and sequences. Unescaping reverses this, taking an escaped JSON string and converting the escape sequences back into the actual characters, turning a backslash n back into a real newline. You escape when building JSON and unescape when reading a value out of it into plain text.
The need arises constantly in development. Whenever you embed arbitrary text, a user message, a file path, a snippet of code, a block of HTML, inside a JSON string, it must be escaped or the JSON breaks. File paths on some systems use backslashes, which must be doubled. Text with quotes, common in prose and code, must have those quotes escaped. Automating this prevents the subtle syntax errors that a single unescaped character causes.
Escaping With a Tool Versus Doing It by Hand
| Character | Escaped as | Why |
|---|---|---|
| Double quote | Backslash then quote | Otherwise it ends the string early |
| Backslash | Two backslashes | It is the escape character itself |
| Newline | Backslash then n | Literal newlines are not allowed in JSON strings |
| Tab | Backslash then t | Literal tabs are not allowed either |
Who Needs to Escape JSON

Pro Tips for Safe JSON Strings
Common JSON Escaping Mistakes to Avoid
Related Tools You May Need Next
After escaping, validate and compress your JSON with our JSON Minify tool, or convert it with JSON to YAML and JSON to CSV. To escape for a different context, related encoding tools handle HTML and URL escaping.

Frequently Asked Questions
What does escaping a string for JSON do?
Escaping adds backslashes before characters that have special meaning in JSON, so they are treated as literal text rather than syntax. A double quote becomes a backslash followed by a quote, a backslash is doubled, and newlines and tabs become escape sequences. This lets you safely embed any text inside a JSON string without the special characters breaking the JSON structure, which they otherwise would.
Why do I need to escape text in JSON?
Because JSON strings are wrapped in double quotes, any double quote within the text would end the string early and break the JSON. Backslashes have special meaning too, and characters like newlines cannot appear literally in a JSON string. Escaping converts these into safe forms, so arbitrary text, including quotes, paths, code and multi line content, can be embedded in JSON without producing a syntax error.
What is the difference between escaping and unescaping?
Escaping takes readable text and makes it safe for JSON by adding backslashes and escape sequences, which you do when building JSON. Unescaping reverses this, converting an escaped JSON string back into the actual characters, turning a backslash n back into a real newline, which you do when reading a value out of JSON into plain text. They are exact inverses of each other.
Which characters need to be escaped in JSON?
The most common are the double quote, which would otherwise end the string, and the backslash, which is the escape character itself and must be doubled. Control characters also need escaping: a newline becomes a backslash followed by n, and a tab becomes a backslash followed by t, since literal newlines and tabs are not allowed inside a JSON string. The tool handles all of these automatically.
Why does my JSON break when I add a file path?
File paths on some systems use backslashes, and a single backslash in a JSON string is interpreted as the start of an escape sequence. This corrupts the path or invalidates the JSON. Each backslash in the path must be doubled when embedded in JSON. Escaping the path with this tool doubles the backslashes correctly, so the path is stored accurately and the JSON stays valid.
Can I unescape a string to read it clearly?
Yes. If you have a JSON string value full of escape sequences, doubled backslashes and escaped quotes, that is hard to read, unescaping it converts those sequences back into the actual characters, revealing the real text. This is very useful when debugging or trying to understand the content of a JSON value, since the escaped form is designed for machines rather than easy human reading.
What happens if I escape text twice?
Escaping already escaped text adds an extra layer of backslashes, corrupting the value so that when it is later unescaped once, it does not return to the correct original. Only escape plain, unescaped text, and do so a single time. If text is already escaped and you need to work with it, unescape it to get the plain form rather than escaping it again.
Is the JSON escape tool free?
Yes, it is completely free with no account and no usage limit. You can escape and unescape as many strings as you like, as often as you like, at no cost. It runs entirely in your browser on any device, so your text is processed locally and there is nothing to download or install, and the result is ready to copy the moment you process the string.