Skip to content
Toolwright

String Escape & Unescape

String Escape & Unescape escapes quotes, newlines and backslashes so text can sit inside a string literal in JSON, JavaScript, Python, C#, SQL or a POSIX shell, and unescapes escape sequences back into characters. It runs in your browser.

Tool 106 · Encoders & hashes
Outside requests …How to checkRuns on this deviceWorks offline once opened

How to use String Escape & Unescape

  1. Paste your text.
  2. Choose the language and whether to escape or unescape.
  3. Copy the result.

Frequently asked questions

How do I escape a string for JSON?

Paste the text, choose JSON and copy the escaped result, ready to put between double quotes.

Which languages are supported?

JSON, JavaScript, Python, C#, SQL and POSIX shell.

Is escaping enough to prevent SQL injection?

No. Use parameterized queries. Escaping is for building literals by hand, not a security measure.

Next step

Need Unicode escape sequences specifically? Convert them. Open Unicode Escape & Unescape.

  1. 039

    HTML Entity Encoder & Decoder

  2. 056

    JSON Formatter & Validator

  3. 125

    Unicode Escape & Unescape

  4. 004

    Base64 Encode & Decode