String Escape
Escape strings for a specific target language
What is String Escape?
A string escaping tool applies the quoting rules of Java/C#, JavaScript, Python, SQL, Shell, or CSV — handling quotes, backslashes, and newlines — and reverses the process just as easily. Use it to drop a chunk of text full of special characters safely into source code. Everything runs locally in your browser.
How to use String Escape
- 1Choose the target language and the direction, escape or unescape.
- 2Paste your text; the result updates as you type.
- 3When pasting the result into code, make sure the surrounding quote character matches the style you selected.
Frequently asked questions
Why does the Shell output wrap everything in single quotes?+
Inside single quotes a POSIX shell treats every character literally except the single quote itself, which makes it the least error-prone escaping strategy there is. An embedded single quote has to close the string, append an escaped quote, and reopen it — that is the '"'"' sequence you see in the output.
Does SQL escaping protect against injection?+
Doubling single quotes makes the statement syntactically valid, but you are still assembling SQL by concatenating strings. Real protection comes from parameterized queries, where the driver sends the value as a bound parameter instead of splicing it into the SQL text. Use the SQL mode here only for one-off scripts.
Related tools
All toolsText Diff Checker
Compare two blocks of text line by line, optionally ignoring whitespace
JSON Diff
Compare two JSON documents structurally, by key path
Regex Tester
Test regex matches live and inspect every capture group
Case Converter
Convert identifiers between camelCase, snake_case, kebab-case, and more
Word Counter
Count words, characters, lines, and estimated reading time
AI Token Counter
Count AI tokens and estimate what a call will cost