String Escaper
Escape and unescape strings for JSON, JS, HTML, XML, SQL, RegExp, and shell.
Input
Escaped
Unescaped (treating input as escaped)
Unexpected token 'H', "Hello "wor"... is not valid JSON
About the String Escaper
Escape or unescape text for use in JSON strings, JavaScript source, HTML/XML markup, SQL literals, regular expressions, or shell commands — all in one place.
Examples
HTML escape
<a href="x">Output
<a href="x">Keyboard shortcuts
- Copy the main outputCtrl / ⌘ + Shift + C
- Download the resultCtrl / ⌘ + S
- Share this toolCtrl / ⌘ + Shift + S
- Reset the inputsAlt + R
- Open the tool search paletteCtrl / ⌘ + K
Related tools
Code Comment Stripper
Dev Utilities
Remove comments from JS, HTML, Python, or SQL source.
Code Screenshot Generator
Dev Utilities
Turn code snippets into shareable syntax-highlighted images.
Line Sorter & Deduper
Dev Utilities
Sort, dedupe, and filter lines with regex include/exclude.
Markdown TOC Generator
Dev Utilities
Build a linked table of contents from Markdown headings.
Regex Cheatsheet
Dev Utilities
Searchable regex syntax reference with examples and copy buttons.
Regex Tester
Dev Utilities
Test regular expressions with live match highlighting.
Frequently asked questions
Read more
- Regex patterns every developer should know
A working set of regular expressions for emails, URLs, whitespace and validation — plus how to test them safely.
Version 1.0.0 · Updated 2026-08-06 · Runs entirely in your browser