Escape and unescape strings for JSON, URL, HTML, RegEx, Unicode, Base64, and SQL modes β live as you type.
String Escape / Unescape handles escaping and unescaping for seven distinct contexts: JSON (backslash sequences like \n, \t, \"), URL percent-encoding via encodeURIComponent, HTML entity encoding (& < >), RegEx special character escaping, Unicode \uXXXX sequences, Base64 encoding with btoa/atob, and SQL single-quote doubling. Switch between modes with a single click, and toggle between escape and unescape direction instantly.
Output updates live as you type, and a character-count diff shows exactly how much the transformation changed the string length. All processing is client-side β no string content is ever transmitted to a server.
JSON mode escapes characters according to the JSON specification: backslashes, double quotes, and control characters (\n, \t, \r, \f, \b). JavaScript string literals support both single and double quotes plus template literal syntax, which has a slightly broader set of escape sequences β but for embedding strings in JSON payloads, the JSON mode here is exactly what you need.
Use URL encoding for values passed in query strings, path segments, or form data submitted over HTTP β it converts spaces to %20 and reserved characters to percent-encoded sequences. Use HTML encoding when inserting dynamic text into an HTML document β it converts < > & and quotes to named entities to prevent the browser from interpreting them as markup.
Yes. Escape your string in JSON mode first, then click the Swap button to move the output back to the input, switch to Base64 mode, and escape again. This workflow lets you produce Base64-encoded JSON strings or any other multi-step encoding chain without leaving the tool.