Cubestack

String Escape / Unescape

Free string escape tool — escape and unescape text for JSON, JavaScript, HTML, XML, URLs, SQL, regex, CSV and Unicode escapes, so quotes and special characters don't break your code.

Input
Escaped

What is the String Escape / Unescape?

Escaping replaces characters that have special meaning — quotes, < and &, new lines — so text can sit safely inside code, HTML, URLs or SQL. Unescaping turns it back.

How to use it

  1. 1

    Choose the format

    Where the text will go.

  2. 2

    Escape or unescape

    Pick the direction.

  3. 3

    Copy the result

    Paste into your code.

Features

  • 9 formats

    JSON, JavaScript, HTML, XML, URL, SQL, regex, CSV and Unicode \u.

  • Both ways

    Escape and unescape.

  • Live

    Updates as you type.

Popular uses

  • JSON strings

    Quotes and new lines in values.

  • HTML

    Show code samples on a page.

  • Regex

    Match text literally.

Frequently asked questions

Is SQL escaping enough to stop SQL injection?

No — use parameterised queries. Escaping is for one-off strings.

What's the difference between URL and HTML escaping?

URL escaping uses %20 style codes; HTML uses entities like &amp;.

Related tools