Text input
Paste your text, choose a format, then escape or unescape.
Result
Waiting for input.
Escape text for code for free. Convert plain text into safe HTML, JavaScript, JSON, CSV, URL, SQL or regex form, and unescape it back. Runs in your browser.
Paste your text, choose a format, then escape or unescape.
Waiting for input.
Special characters break code when pasted raw: quotes end strings early, angle brackets become tags, and newlines are illegal inside single-line strings. Escaping rewrites those characters into safe sequences the target language understands.
This tool covers the seven formats developers reach for most, HTML, JavaScript, JSON, CSV, URL, SQL and regex, each with a matching unescape direction.
Use HTML entities when injecting user text into a page, JSON escaping when building API payloads by hand, and URL encoding for query parameters. CSV escaping matters when a field itself contains commas or quotes, and SQL escaping is a last resort, parameterized queries are always safer.
Regex escaping is handy when you want to search for literal text like prices ($9.99) without the dots and dollar sign acting as pattern operators.