Skip to main content

String Escape & Unescape

Escape or unescape strings for JSON, JavaScript, HTML, URL, and Unicode. Click Escape or Unescape to process.

Mode:
Input
Output
Click Escape or Unescape to process

Mode Reference

JSON Escapes quotes, backslashes, newlines, tabs
JavaScript Same as JSON + single quotes, null bytes
HTML Escapes < > & " '
URL encodeURIComponent / decodeURIComponent
Unicode Non-ASCII to \uXXXX escape sequences

How to Escape and Unescape Strings

Every language has different escape rules. This string escape tool encodes and decodes JSON, JavaScript, HTML, URL, and Unicode sequences so you can paste a value into a config or a snippet without breaking the surrounding syntax.

Processing is client-side. Use JSON mode for JSON.stringify-style quotes, HTML mode for entities, and Unicode mode for \uXXXX sequences. The Base64 tool is the right choice when you need binary-safe encoding instead of escapes.

Tips

  • Escape before embedding a user string inside JSON — unescaped quotes will break parsers.
  • HTML escape is not a full XSS sanitizer; it is for putting text into markup safely as content.
  • Round-trip: escape then unescape to confirm you did not lose characters.

More from Shane Code