Herramienta de Escape/Unescape de Cadenas
Format strings for various programming languages and data formats. Escape or unescape for JavaScript, HTML, CSV, JSON, and more.
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
- When including strings in programming code (JavaScript, Python, etc.)
- When creating HTML or XML content dynamically
- When generating JSON data
- When constructing URLs with query parameters
- When working with CSV data containing quotes or commas
- When creating SQL queries with string parameters
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:
\"
- Double quote\'
- Single quote\\
- Backslash\n
- Newline\r
- Carriage return\t
- Tab\b
- Backspace\f
- Form feed\uXXXX
- Unicode character
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:
<
- Less than sign (<)>
- Greater than sign (>)&
- Ampersand (&)"
- Double quote (\")'
- Apostrophe (')
URL Encoding
URL encoding replaces special characters in URLs with percent-encoded values. For example:
%20
- Space%3F
- Question mark (?)%26
- Ampersand (&)%3D
- Equals sign (=)%25
- Percent sign (%)
Benefits of Our String Escape Tool
- Support for multiple programming languages and data formats
- Both escaping and unescaping functionality
- Customizable options for handling different types of characters
- Instant results with real-time processing
- Free to use with no limits
- Works directly in your browser with no software installation needed