Transform Your Text, Empower Your Words

String Escape/Unescape Tool

Format strings for various programming languages and data formats. Escape or unescape for JavaScript, HTML, CSV, JSON, and more.

Format Options

?

Result:

Quick Reference Examples

JavaScript String Escaping

// Original string
const original = "Line 1
Line 2 with "quotes" and 'apostrophes'";

// Escaped string
const escaped = "Line 1\nLine 2 with \"quotes\" and 'apostrophes'";

HTML String Escaping


This is a paragraph with bold text and a & symbol.

This is a paragraph with bold text and a & symbol.

URL String Escaping

// Original URL
https://example.com/search?q=query with spaces&category=programming

// Escaped URL
https://example.com/search?q=query%20with%20spaces&category=programming

CSV String Escaping

// Original CSV data
Name,Description,Price
Product 1,"Description with, comma",19.99

// Escaped CSV data
Name,Description,Price
Product 1,"Description with, comma",19.99

What is String Escaping?

String escaping is the process of converting special characters in a string to a format that can be safely used in a specific context, such as programming code, data files, or URLs. Escaping ensures that special characters are interpreted correctly and don't break the syntax or functionality of the code or data structure.

When to Use String Escaping

Types of String Escaping

JavaScript String Escaping

JavaScript requires escaping of special characters such as quotes, newlines, and backslashes within strings. Common escape sequences include:

HTML Escaping

HTML escaping converts special characters to their HTML entity equivalents to prevent them from being interpreted as HTML markup. Common HTML entities include:

URL Encoding

URL encoding replaces special characters in URLs with percent-encoded values. For example:

Benefits of Our String Escape Tool