Escape and unescape strings for JSON, JavaScript, HTML entities, URL percent-encoding, regex special characters, and SQL. Supports encode and decode in one tool.
The String Escape & Unescape tool handles all the encoding and decoding tasks developers encounter when embedding text in different contexts. Whether you need to escape a user's input before embedding it in a JSON payload, encode a URL parameter, convert characters to HTML entities for safe rendering in a browser, escape a string for use in a regular expression, or sanitize a value before inserting it into SQL, this tool provides a dedicated mode for each format. Simply choose your encoding type, paste the raw or encoded text, and receive the correctly transformed output—eliminating the risk of subtle escaping mistakes that cause security issues or parsing errors.
QWhat is the difference between URL encode and HTML entity encode?
URL encoding (percent-encoding) represents characters as %XX hex sequences for safe transmission in URLs. HTML entity encoding uses & syntax like & or < to display reserved characters safely in HTML.
QDoes JSON escape handle Unicode characters?
Yes. Non-ASCII characters can be left as UTF-8 or converted to \uXXXX Unicode escape sequences, depending on your selected option.
QWhat SQL escaping style is used?
The tool supports two SQL modes: ANSI standard (double single-quotes: '' for '), and MySQL/PostgreSQL backslash mode (\' for '). Select the appropriate mode for your database.
QCan I detect what encoding is already applied to a string?
Yes. The 'Auto-detect' mode attempts to identify whether the input is URL-encoded, HTML-encoded, or JSON-escaped and applies the matching decode automatically.