← All Tools

\\ String Escape / Unescape

Escape and unescape strings for JSON, JavaScript, HTML, URLs, and regular expressions.

Runs in your browser

String escaping runs locally. Escaping is not sanitization; choose the target context carefully and avoid sharing secrets, tokens, or private payload fragments in debug output.

What this tool does

String Escape / Unescape converts text between raw strings and escaped forms for code, JSON, HTML, or command contexts.

Why it is useful

It helps developers safely inspect quotes, backslashes, newlines, tabs, and special characters.

How it works

The browser applies selected escaping or unescaping rules and displays the transformed string.

Best input

Choose the target context first, because JSON, JavaScript, HTML, shell, and URL escaping are different.

Debugging tip

Avoid double-escaping by checking what the receiving system expects.

Privacy note

String transformation happens locally in your browser.

Important limitation

Escaping is context-specific. Correct escaping for one language or format can be wrong or unsafe in another.

Quick answers

Why did my output get extra slashes?

The string may have been escaped more than once.

Is escaping the same as sanitizing?

No. Security-sensitive sanitization requires context-aware handling in the target application.

Related Tools

{}JSON Formatter🔐Base64 Encode / Decode🔗URL Encoder / Decoder<HTML Entity Encoder.*Regex Tester🎫JWT Decoder
View all in Code →

Common Use Cases

Escape strings for JSON or JavaScript

Properly escape quotes, backslashes, and special characters when building JSON payloads or JS strings.

Prepare strings for SQL queries

Escape single quotes and other special characters to prevent SQL injection when constructing queries.

Decode escaped strings from logs or APIs

Unescape strings that appear encoded in server logs, API responses, or configuration files.

Related Tools

{}JSON Formatter🔐Base64 Encode / Decode🔗URL Encoder / Decoder<HTML Entity Encoder.*Regex Tester🎫JWT Decoder
View all in Code →