Tech News, Tech & Coding · Free Online Tools

IT Question Answer
Developer & Text ToolsFree100% Client-Side

String Escape & Unescape Tool

Escape or unescape text for JSON, JavaScript, HTML, XML, SQL, CSV and regular expressions.

100% privateRuns instantly in-browserUpdated regularly
Loading tool…

Advertisement

100% Secure & Private

Your files never leave your computer — processed in-browser with WebAssembly.

Lightning Fast

No queues, no uploads — results in milliseconds, even on mobile.

Modern & Ad-Light

Clean interface, dark mode, and no popups — built to beat legacy tools.

What you get

  • Seven formats
  • Escape and unescape
  • Live conversion
  • One-click copy
  • 100% client-side

What escaping is

Some characters have a special meaning in a given format. A double quote ends a JSON string, a less-than sign starts an HTML tag, and a single quote ends a SQL string. To use these characters as plain text, you add an escape: a backslash, an entity or a doubled quote. Unescaping reverses it. This tool does both for seven common formats.

How to use it

  • Choose Escape or Unescape.
  • Pick the format.
  • Paste your text and copy the result.

What each format does

  • JSON string: escapes quotes, backslashes and control characters such as new lines. Output has no outer quotes, ready to place inside a string.
  • JavaScript string: escapes backslashes, both kinds of quotes, new lines, returns and tabs.
  • HTML entities: turns & < > " and the apostrophe into &amp; &lt; &gt; &quot; and &#39;. Escaping user input this way helps prevent cross-site scripting.
  • XML: like HTML, with &apos; for the apostrophe.
  • SQL string: doubles single quotes, as in O''Brien. Use parameterised queries in real code instead of building SQL strings.
  • CSV field: wraps the field in quotes and doubles quotes inside it when it has a comma, quote or line break.
  • Regex: puts a backslash before characters with special meaning, so text can be matched literally.

Example

JSON escaping of text with a quote and a backslash:

Plain text:   He said "hello"\nPath: C:\temp

JSON escaped: He said \"hello\"\nPath: C:\\temp

Security reminder

Escaping by hand is easy to get wrong. In applications, use the escaping built into your framework and parameterised database queries, not string concatenation. Use this tool to understand, test and debug escaped text.

Related tools

Advertisement

Frequently asked questions

Escaping marks special characters so they are treated as text in one format. Encoding, such as Base64 or URL encoding, converts data into another representation.

So you can paste it straight inside a string. Add your own quotes around it.

JSON, JavaScript, HTML, XML, SQL, CSV and regular expressions.

Yes. Switch to Unescape and paste the escaped text.

No. It is processed in your browser.