JSON String Escaper

Escape and unescape strings for JSON. Convert special characters like quotes, newlines, and tabs to their escaped equivalents. Perfect for preparing strings for JSON embedding.

Input Text
Output
Result will appear here...

Escaped Characters

\n

Newline

\t

Tab

\"

Double Quote

\\

Backslash

Why Escape JSON Strings?

When embedding text in JSON, certain characters like double quotes, backslashes, and newlines must be escaped to maintain valid JSON syntax. This tool helps you quickly convert strings to their JSON-safe format and vice versa.

Frequently Asked Questions

What characters need to be escaped in JSON?
In JSON strings, you must escape: double quotes (\"), backslashes (\\), newlines (\n), carriage returns (\r), tabs (\t), form feeds (\f), and backspaces (\b).
When do I need to escape strings?
You need to escape strings when embedding user input or multi-line text into JSON, when constructing JSON strings programmatically, or when storing text that contains special characters in JSON format.
What is the difference between escape and unescape?
Escape converts readable characters into their JSON-safe escaped form (e.g., newline becomes \n). Unescape does the reverse, converting escaped sequences back to their original characters.
Is this tool safe to use?
Yes, all processing happens locally in your browser. Your text is never sent to any server, ensuring complete privacy and security.
Can I use this for other languages?
The escape sequences used in JSON are similar to many programming languages like JavaScript, Python, and Java. However, some languages may have additional escape sequences not covered here.