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
You Might Also Like
Explore more tools in this category
Character Counter
Count characters, words, and sentences
Text Cleaner
Remove extra spaces, newlines, and other characters
Readability Analyzer
Calculate Flesch-Kincaid reading level, grade score, and readability metrics
Case Converter
Convert text case
Text Repeater
Repeat text multiple times with separators
Text Reverser
Reverse text, words, or letters
Palindrome Checker
Check if a word or phrase is a palindrome with animated highlighting
Text to ASCII
Convert text to ASCII
ASCII to Text
Convert ASCII to text
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: <div>Hello & Welcome</div>
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