String Escaper

Escape and unescape strings for JSON, HTML, XML, SQL, JavaScript, and more. Essential tool for developers working with different data formats.

Format Examples

JSON

Original: Hello "World"
Escaped: Hello \"World\"

HTML

Original: <div>Hello</div>
Escaped: &lt;div&gt;Hello&lt;/div&gt;

SQL

Original: O'Neill
Escaped: O''Neill

URL

Original: hello world
Escaped: hello%20world

Features

  • Support for multiple formats
  • Bidirectional conversion (escape/unescape)
  • Handles special characters properly
  • Copy to clipboard functionality
  • Real-time processing
  • No data stored - completely private

String Escaper FAQs

Which escape modes are supported?

Six formats: JSON, HTML, XML, SQL, JavaScript, and URL. Select a format button first, then use Escape or Unescape on your text; the chosen mode applies to both directions.

How does the SQL mode escape quotes?

By doubling single quotes, the standard SQL convention, so a name like O'Neill becomes O''Neill. Unescaping reverses the doubling. Note that parameterized queries remain the safest defense against SQL injection.

When would I pick JavaScript mode over JSON?

JavaScript escaping also handles single quotes and vertical tabs, which JSON leaves alone. Use JSON mode when the output goes into JSON files or APIs, and JavaScript mode when the string is embedded directly in JS source.

What happens if I unescape invalid input?

The URL decoder is forgiving: an invalid percent sequence simply returns your text unchanged. Other modes reverse their escape rules directly, and if a conversion genuinely fails, the output box shows an error message rather than breaking the page.

Is my text uploaded during conversion?

No. Every escape and unescape operation is plain client-side JavaScript running in this page. Nothing is logged, stored, or sent to a server.