String Escape & Unescape — JSON, JS, HTML, URI, SQL
Escape and unescape strings for five formats: JSON, JavaScript, HTML, URI components, and SQL literals. Fast, browser-only, safe for copy-paste.
Runs 100% in your browser — nothing is uploaded.
Frequently asked
JSON when embedding a value into JSON. JS for template strings or inline strings in code. HTML for content injected into a page. URI for query params or path segments. SQL when building a literal by hand (though you should really use parameterized queries).
This tool only doubles single quotes — enough for a literal string in most SQL dialects, but NOT a substitute for parameterization or prepared statements in application code. Use it for one-off ad-hoc queries only.
JSON mode preserves Unicode as-is (JSON.stringify does not escape by default). JS mode does the same. HTML entity encoding covers the reserved 5 chars only; add numeric character references (&#…;) if you also need to encode arbitrary code points.
Related tools
- JSON String EscapeEscape any text for safe embedding as a JSON string, or unescape a JSON string b
- HTML EntitiesEncode and decode HTML entities: &, <, ©, and every numeric &#nn
- URL Encode / DecodePercent-encode or decode URLs, query strings, and path segments. Choose between
- .env File ParserParse a .env file and see it as a JSON object. Handles comments, quoted values,
- Base ConverterConvert numbers between binary, octal, decimal, and hexadecimal. Supports huge n
- Credit Card ValidatorValidate credit card numbers with the Luhn algorithm and detect the brand: Visa,