Data & Formats

String Escaper

Escape or unescape text for JSON, SQL, shell, regex, HTML and backslash.

Embed strings safely

When you drop text into code — a JSON value, a SQL query, a shell command, a regular expression — characters like quotes, backslashes and newlines have special meaning and must be escaped or they'll break the syntax (or open an injection hole). This escapes text for each context, and unescapes it back where that's well-defined.

  • JSON — wraps and escapes to a valid JSON string; unescape parses it back.
  • SQL — doubles single quotes (' → ''). Parameterised queries are still safer than escaping by hand.
  • Shell — single-quote-wraps so the shell treats it literally.
  • Regex — escapes metacharacters so the text matches literally.
  • HTML — escapes < > & and quotes.
  • Backslash — C/Java-style \n \t \" sequences.

Escaping is a last resort — prefer parameterised queries and proper APIs over hand-escaping untrusted input. Everything runs in your browser.

These calculators run entirely in your browser — nothing you type is sent anywhere. Results are estimates for planning; validate against your vendor's documentation before you buy or deploy.