String Escape & Unescape

Escape and unescape strings for JavaScript, JSON, HTML, URL, XML, and CSV

Input

Enter the string you want to escape

0 characters

Output

Escaped string result

0 characters

About String Escape & Unescape

What is String Escaping?

String escaping is the process of converting special characters into a format that can be safely used in different contexts (code, data formats, URLs, etc.). Unescaping reverses this process to restore the original characters.

Supported Formats

  • JavaScript/JSON: Escapes quotes, newlines, tabs, backslashes
  • HTML: Converts <, >, &, quotes to HTML entities
  • URL: Percent-encodes special characters for URLs
  • XML: Escapes XML special characters
  • CSV: Handles commas and quotes in CSV fields

Common Use Cases

  • Preparing strings for JSON data
  • Safely displaying user input in HTML
  • Encoding URLs with special characters
  • Handling CSV data with commas and quotes
  • Working with XML/SOAP APIs
  • Debugging escaped strings in code
  • Data migration and transformation

Features

  • 6 different escape/unescape formats
  • Bidirectional conversion (escape ↔ unescape)
  • Real-time character count
  • One-click copy to clipboard
  • Swap input/output functionality
  • Example strings for each format
  • 100% client-side processing (private & secure)

Examples

JavaScript/JSON:

Input: Hello "World"\nNew Line

Output: Hello \"World\"\\nNew Line

HTML:

Input: <div>Hello & Welcome</div>

Output: &lt;div&gt;Hello &amp; Welcome&lt;/div&gt;

URL:

Input: Hello World! How are you?

Output: Hello%20World!%20How%20are%20you%3F

Tips

  • Use "Load Example" to see format-specific examples
  • Use "Swap" to quickly reverse the operation
  • Select the correct format for your use case
  • Test with your actual data before using in production
  • Remember that some characters may need multiple escaping levels