Convert special characters to their escaped versions for safe use in code
JavaScript
- Escape strings for JS code and JSON dataPython
- Prepare strings for Python 2/3 code and APIsHTML
- Encode special characters for HTML/XML documentsJSON
- Strict escaping for JSON data interchangeJava
- Format strings for Java applicationsC#
- Escape strings for .NET applicationsEscape Unicode
: Convert non-ASCII characters (like emojis) to Unicode escapesPreserve newlines
: Keep line breaks as-is instead of converting to \n1. You paste: Hello "World"! ❤️
2. Select JavaScript format
3. Output becomes: Hello \"World\"! \u2764\uFE0F
"
→ \"
)\
→ \\
)<
→ <
)Escaping prevents code injection and ensures special characters don't break your syntax.
Only when you need ASCII-only output or are working with legacy systems.
Modern browsers handle escaped strings efficiently - no noticeable impact.