jarvisbox

String Escaper

Escape and unescape strings for JSON, SQL, shell, and regex.

100% in your browser. Your file never leaves your device.

Type or paste text above, then click Escape or Unescape.

Why use a string escaper?

Forgetting to escape special characters is a common source of bugs and security vulnerabilities. Unescaped quotes in SQL queries cause syntax errors or SQL injection. Unescaped backslashes in JSON break parsers. Unescaped metacharacters in regex patterns match unintended text. This tool handles all these cases so you can focus on your logic rather than manually counting backslashes. Escaping happens entirely in your browser, keeping sensitive strings off third-party servers.

How to use

Choose the target context using the tabs: JSON for JavaScript objects and APIs, SQL for database queries, Shell for command-line arguments, or Regex for regular expression literals. Paste your raw string in the input and click Escape to produce a safe version. Click Unescape to reverse the process. Note that Shell mode always wraps the output in single quotes — paste the entire output including quotes into your script. Click Copy to put the result in your clipboard.

Preguntas frecuentes

Why do I need to escape strings for JSON?
JSON strings must escape backslashes, double quotes, and control characters. Unescaped strings cause parse errors when embedded in JSON. This is especially common when constructing JSON by hand or embedding user input.
What characters are escaped in shell mode?
Shell mode wraps the string in single quotes, which is the safest quoting method in POSIX shells. Single quotes inside the string are replaced with the sequence '\'' which ends the quote, appends a literal single quote, then reopens the quote.
What does regex escaping do?
Regex escaping adds a backslash before metacharacters (. * + ? ^ $ { } [ ] | ( ) \) so the string is treated as a literal pattern rather than a regex. Useful when building a regex that includes user-provided text.
Reportar un problema con esta herramienta