Escape text so it survives inside a quoted literal in six different languages, or reverse it. Each target has its own rules and this names which one you chose.
Waiting for text to escape
Backslash, both quote characters, the backtick, and the control characters. U+2028 and U+2029 are escaped too: they are line terminators in older JavaScript and a literal one inside a string was a syntax error.
The result appears here
Ready to paste between quotes in your chosen language.
String Escape runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
Escape this string is six different operations and the differences matter. A double quote needs a backslash in JavaScript and a doubled quote in CSV. A single quote needs doubling in SQL and a very particular treatment in a shell. A dot needs escaping in a regular expression and nothing at all anywhere else. Picking the wrong set is how a quote ends up terminating the statement it was meant to sit inside.
Escaping is not sanitisation and it is not protection, and the page says so where it matters rather than in a footnote. The SQL target produces a correctly quoted literal; it does not make building a query by string concatenation safe. The right escape depends on the connection's character set, and a parameterised query avoids the question altogether. Use this for reading a value, for a fixture, or for a migration you are writing by hand — not as a defence.
Shell quoting is the other one worth care. Single quotes are the only form a shell treats as entirely literal, so that is what this produces. The result is correct for a single argument in a POSIX shell, and it is not a general-purpose way to build a command line out of untrusted input, which is a thing that should not be done at all.
Unescaping is the inverse wherever an inverse exists. It is not guesswork: a sequence that looks like an escape but is not valid in the chosen target is reported and left exactly as written. A tool that quietly half-decodes one character in the middle of a long string is worse than one that refuses, because the damage is invisible until something downstream breaks.
The JavaScript target asks which quote character you are using, because the answer changes the output. Inside double quotes a single quote needs nothing; inside a template literal a backtick and a dollar-brace both do. Nothing is uploaded — the text stays in your browser, which is what makes it safe for a value that is itself a secret.
No. It produces a correctly quoted literal, which is not the same thing. The right escape depends on the connection's character set, and parameterised queries remove the question entirely. Use this for reading values and writing fixtures, never as a defence against injection.
Because the answer changes the output. A single quote needs no escape inside double quotes, a backtick and a dollar-brace both need one inside a template literal, and escaping everything regardless makes the result harder to read than it needs to be.
CSV has no backslash. A quote inside a field is written by doubling it, and a field containing a delimiter, a quote or a newline is wrapped in quotes. That is RFC 4180, and it is why a CSV value with a backslash in it needs nothing done to the backslash.
It is left exactly as written and reported. Guessing at a malformed sequence is how a tool silently corrupts a string, and a visible refusal is far more useful than an invisible mistake.
No, it escapes what the target requires. To write an accented letter or an emoji as an escape sequence rather than as itself, the Unicode escape converter does that, in seven notations.
No. Everything runs in your browser and nothing reaches a server or analytics, which matters because the string you are escaping is often itself a credential.