Free · Private · In-Browser

String Escaper

Escape pasted strings for common developer contexts locally.

Output
 

Escape strings for code

Dropping text into a code string means escaping the characters that would break it — quotes, backslashes, newlines — and the rules differ by context. This escaper prepares pasted text for common developer contexts like JSON and HTML, so it is safe to embed.

Manual escaping is tedious and easy to get subtly wrong, especially with mixed quotes and special characters. Paste your text, pick the context, and copy the correctly escaped result to drop into your code or config.

Escaping for code, locally

It escapes the quotes, backslashes, and newlines that would otherwise break a string in your target language. The transform runs in your browser and never uploads anything.

Frequently asked questions

Which escaping modes are available?

JSON, JavaScript, HTML, CSV, and shell, each following that format's rules.

Which characters does HTML escaping change?

&, <, >, and double quotes become &amp;, &lt;, &gt;, and &quot;, so the text displays instead of being read as markup.

How are CSV values escaped?

The value is wrapped in double quotes and any quote inside it is doubled, following the CSV standard.

Take it further
Developer Tools

Practical utilities for everyday web development work.

Learn more