Escape Text for Code
Escape text for JSON, JavaScript, SQL, a shell, a regular expression, CSV or a URL, and unescape it again.
Goes between the quotes of a JSON string.
Files are processed in your browser and are never uploaded to a server.
How to use
Free to use with no sign-up, no install and no usage limit.
Paste text, pick where it is going, and the escaped version appears. Switch direction to turn an escaped string back into plain text.
Every destination has its own rules and they do not agree. SQL doubles a single quote; JavaScript puts a backslash in front of it; a shell cannot escape one inside single quotes at all and has to close the quotes, insert it, and reopen them.
Getting it wrong is not only a syntax error. An unescaped quote in a SQL string is how injection works, and an unescaped value in a shell command is how a filename becomes a command.
JSON escaping is done by the language itself rather than by hand, because a hand-written version always misses something — usually the control characters below U+0020, which have to become \u00XX.
Regular expressions and shell quoting cannot be reversed. Several different inputs escape to the same output, so there is no single right answer going back, and guessing would be worse than refusing.
All seven forms are shown side by side at the bottom, which makes it obvious how differently the same text has to be written depending on where it lands.
Nothing you paste is sent to a server. Everything runs inside your browser.