Language Detector
Work out what language a piece of text is written in.
Escape a string for JSON, JavaScript, SQL, shell or regex.
Escape Text escapes a string for the format you name — JSON, JavaScript, HTML, SQL, shell, CSV, regex or URL — following that format's own rules rather than a generic approximation, so the result is genuinely valid in that context.
Every format has characters it treats specially, and putting one in a string without escaping it is how injection bugs and syntax errors both happen. A quote inside a JSON string, a backslash inside a regular expression, a semicolon inside a shell argument — each needs its own escape, and each format\'s rules are different.
This escapes text for the format you choose, following that format's actual rules rather than a generic approximation. JSON escapes quotes, backslashes and control characters as the specification requires. SQL doubles single quotes. Shell single-quotes the whole string and handles embedded quotes correctly. Regex escapes every metacharacter. CSV doubles quotes and wraps fields containing delimiters. The result is safe to paste into that context.
Each with its own rules — SQL doubles quotes, regex escapes metacharacters, shell wraps and requotes.
JSON and JavaScript get \n, \t and \uXXXX forms, as their specifications require.
Where a format needs the string quoted, the quotes are part of the output rather than left to you.
Quotes doubled and the field wrapped only when it contains a delimiter, quote or newline.
The page states plainly that parameterised queries, not escaping, are the answer to SQL injection.
The string that needs to go into code, a query or a config file.
JSON, JavaScript, HTML, SQL, shell, CSV, regex or URL.
Each format's own rules are applied, including any required wrapping quotes.
The result is valid for the context you selected.
No. Use parameterised queries — they are the only reliable defence, because escaping depends on knowing the exact database, character set and context. This tool is for building a literal by hand, not for handling user input in an application.
It puts a backslash before every character that has a special meaning in a pattern, so the text is matched literally. Without it, a full stop matches any character and a question mark makes the previous element optional.
The safest approach is to wrap the whole string in single quotes and handle any embedded single quote by closing, escaping and reopening. That is what this tool does, because it is the only form with no special cases left inside.
JSON and JavaScript escaping converts them to their \n, \t and \uXXXX forms, since the specification forbids raw control characters inside a string literal.
What people who use the Escape Text think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the Escape Text. It takes half a minute and no account.
Write the first reviewWork out what language a piece of text is written in.
Remove hard line breaks so paragraphs flow again.
A readability grade based on characters rather than syllables.
Turn plain typing into proper typography — curly quotes, real dashes.
Turn any text into capital letters in one click.
Split a document into paragraphs and measure each one.
Turn Unicode escape sequences back into characters.
Collapse double spaces and trim the ends of every line.