📖 What is Text Escape/Unescape?
String Escape tool encodes special characters for safe use in different contexts — JSON strings, HTML content, URL parameters, SQL queries, CSV fields and more. It also decodes (unescapes) encoded strings back to readable text. Use it to fix encoding issues, prepare strings for insertion into code, or debug garbled text. Everything runs in your browser.
💡 Example
Input
Text: He said "hello" & waved — Context: JSON
Output
He said \"hello\" & waved
🛠️ Common Use Cases
- Escaping strings for JSON (quotes, backslashes, newlines)
- Escaping HTML entities for safe display
- Escaping special characters for SQL queries
- Debugging double-escaped or garbled text
- Preparing strings for CSV fields with embedded commas
📝 Escaping by Context
- JSON — escape quotes, backslashes, newlines, tabs
- HTML — encode < > & " ' as entities
- URL — percent-encode special characters (%20, %26)
- SQL — escape single quotes to prevent SQL injection
- CSV — wrap fields containing commas in double quotes
⚠️ Common Mistakes
- Double escaping — escaping already-escaped text. Decode first, then re-encode once.
- Wrong context — HTML escaping in a URL context (or vice versa) does not protect against injection
- Escaping as security — escaping helps prevent injection, but always use parameterized queries for SQL
❓ Frequently Asked Questions
What is double escaping? ▾
When already-escaped text is escaped again. Decode first, then re-encode once.
Which escaping should I use for API requests? ▾
JSON escaping for request bodies. URL encoding for query parameters. They are different contexts requiring different encoding.
Does escaping prevent SQL injection? ▾
Escaping helps, but parameterized queries (prepared statements) are the proper defense.
Is my data private? ▾
Yes — all processing runs entirely in your browser. Your data is never sent to any server.
Is this tool free? ▾
Completely free — no login, no usage limits, works offline once loaded.
Yes — completely free, no login required, no usage limits.
Is my data private? ▾
Yes — all processing runs in your browser. Your data is never sent to any server.
Does it work offline? ▾
Yes — once the page is loaded, the tool works without an internet connection.