String escape and unescape
Escape or unescape a string for JSON, JavaScript, HTML, URLs, CSV or regular expressions, with clear errors for broken escapes.
Runs in your browserNothing uploadedWorks offline
Loading String escape and unescapeRuns on this device. Nothing is uploaded.
Questions
What does JSON escaping produce?
The inside of a JSON string, without the surrounding quotes: quotes, backslashes and control characters such as line breaks become \", \\ and \n.
Which regex characters are escaped?
The characters with special meaning in a JavaScript regular expression: \ ^ $ . * + ? ( ) [ ] { } | and the slash, so the text matches literally inside /.../ or new RegExp().
When does CSV add quotes?
When the value contains a comma, a double quote, a line break or leading or trailing spaces. Quotes inside are doubled, as RFC 4180 describes.
Related tools
All developer toolsDeveloperJSON escapeEscape text for use inside a JSON string: quotes, backslashes, tabs and line breaks become \", \\, \t and \n.DeveloperBase64 encode and decodeEncode text or any file to Base64 and decode Base64 back to text or the original file, with a URL-safe option.DeveloperBinary to decimalConvert binary numbers of any length to decimal, with hex and octal shown too, exactly and as you type.Developerapplication image videoChecksum verifierDrop a file and paste the published checksum to see if it matches. MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 are detected for you.DeveloperChmod calculatorTick read, write and execute boxes or type 755 or rwxr-xr-x, and get the matching octal, symbolic and chmod command, explained.DeveloperCIDR and subnet calculatorType an IP with a prefix or mask to get the network, broadcast, host range, host count, netmask and wildcard. IPv6 works too.