Skip to main content
DevToys
Encode & decode

String escape

Escape strings for JSON, JS, SQL and regex

Escape target
Input
Output
How to use / Notes

How to use

  1. Enter the string to escape.
  2. Pick the target context (JSON, JavaScript, SQL or regex).
  3. Copy the escaped or unescaped result.

Notes

  • Escaping rules differ per context—pick the mode that matches your use.
  • SQL escaping is a convenience; use parameterised queries to prevent injection.