Escape and unescape text (JSON, JS, SQL, regex)
Escape quotes, backslashes and line breaks for JSON, JavaScript, SQL, regex, CSV and Unicode, or go the other way.
Paste the text to escape.
Escape and unescape text (JSON, JS, SQL, regex): what it is for
Paste the text and choose the format: JSON string, JavaScript, Java or C#, SQL with single quotes, regular expression, CSV field or Unicode sequences. The tool escapes quotes, backslashes, line breaks and special characters.
It also does the reverse, turning escaped text back into the original, and can include the surrounding quotes.
How to use
- Paste the text.
- Choose the format and escape or unescape.
- Copy the result.
When to use it
- Putting text with quotes inside JSON.
- Building regular expressions from a text.
- Reading logs with escaped text.
Frequently asked questions
When do I need to escape text?
When the text goes inside a code string: quotes, backslashes and line breaks would break the JSON, JavaScript or SQL if they are not escaped.
Does escaping in SQL protect against SQL injection?
It helps for manual queries, but in code always use parameterized queries (prepared statements).
Is it really free?
Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.