Runs in this tab · nothing uploaded

EN

English

हिन्दीComing soon

EspañolComing soon

Pinned
HelpyTools

More

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.

All developer tools

↑ ↓ move↵ openesc close

The tray

Install HelpyTools

Get HelpyTools on your home screen or Dock. It opens in its own window, and tools you have opened once keep working offline.