CraftTools

String Escape / Unescape

Guide: Regex Cheat Sheet for Beginners

Nothing you enter or choose here leaves your device. This tool runs in your browser.

How to use

  1. 1Choose Escape or Unescape.
  2. 2Pick the format, such as JSON string or SQL string.
  3. 3Paste your text into the input box.
  4. 4Click Copy result.

Frequently asked questions

What gets escaped?

It depends on the format. Programming languages escape quotes, backslashes, line breaks and control characters. HTML and XML escape & < > and quotes. SQL doubles single quotes. Regex escapes characters like . * + ? and brackets. CSV wraps fields in quotes.

Should I include the surrounding quotes?

The result doesn't include them, so you can paste it between your own quotes. For example, use the JSON result inside double quotes.

What does escaping non-ASCII characters do?

It writes characters such as é and emoji as \uXXXX sequences, which is useful when a file or API only allows plain ASCII.

Can this protect against SQL injection?

No. Escaping isn't a safe way to build SQL. Always use parameterized queries in your code.

Read the guides

Learn how this works and how to get the most from it.

Developer

Regex Cheat Sheet for Beginners

A plain-English guide to regular expressions: character classes, quantifiers, groups, flags and examples you can test.

2 min read

Developer

How to Format SQL So Anyone Can Read It

Simple formatting habits that make SQL queries easy to read and review, plus how to handle quotes and when a formatter helps.

1 min read

HTML Entity Encoder / Decoder

Encode special characters as HTML entities, or decode entities back to text.

Base64 & URL Encoder / Decoder

Encode and decode Base64 and URL-encoded text instantly.

JSON Formatter & Validator

Prettify, minify and validate JSON, with error line numbers.

Regex Tester

Test regular expressions live, with match highlighting and groups.