← All text tools

String escape and unescape

Escape or unescape text for JSON, JavaScript, SQL, CSV, HTML, regex and URLs.

  • Free
  • No sign-up
  • Works on any device

About String escape and unescape

Escape or unescape text for JSON, JavaScript, SQL, CSV, HTML, regular expressions and URLs. Each context has its own special characters: quotes and backslashes in JSON, single quotes in SQL, the pound sign and brackets in regex. Escaping correctly prevents broken strings and injection bugs.

How to use String escape and unescape

  1. Paste the text you want to escape or unescape.
  2. Choose the target format, such as JSON, JavaScript, SQL, CSV, HTML, regex or URL.
  3. Copy the converted text.

Why use this tool?

Also known as

Frequently asked questions

Is escaping enough to prevent SQL injection?

It helps, but parameterized queries are the proper fix. Use prepared statements in code and treat manual escaping as a last resort.

Which characters get escaped in JSON?

Double quotes, backslashes and control characters like new lines and tabs are escaped. Everything else stays as it is.

Why escape text for a regex?

Characters such as dot, star and brackets have special meaning in regex. Escaping them makes the pattern match them literally.

Is String escape and unescape free?

Yes. String escape and unescape on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put String escape and unescape on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools