String Escape / Unescape

Pick a string type and a direction, then type or paste — the result follows along as you go.

How it works

JSON / JS string escapes or unescapes the content you'd write between the quotes of a string literal — newlines become \n, tabs become \t, quotes become \", and so on. JSON and JavaScript string literals use the same escaping rules, so this one mode covers both.

Regex pattern escapes the characters that are special in a regular expression (. * + ? ^ $ { } ( ) | [ ] \) so the text matches itself literally. It has no unescape direction — a backslash in a pattern could mean either "match this character literally" or "the start of an escape sequence," and there's no way to tell those apart after the fact, so write the pattern directly instead.