EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

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.

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Format and convert

Paste the text to escape.

Available in: PortuguêsEspañolEnglish

Advertisement

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

  1. Paste the text.
  2. Choose the format and escape or unescape.
  3. 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.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.