String Escape / Unescape
Escape or unescape strings for JSON, HTML, JavaScript, CSV, and SQL — real-time, client-side, zero dependencies.
How to use String Escape / Unescape
-
Choose a format
Select the escaping format you need: JSON for API payloads, HTML for markup, JavaScript for code strings, CSV for spreadsheet data, or SQL for database queries.
-
Select a direction
Choose Escape to convert plain text to its escaped form, or Unescape to convert an escaped string back to plain text.
-
Paste your input
Type or paste your text into the input panel. The output updates instantly as you type — no button click needed.
-
Review the output
The escaped or unescaped result appears in the output panel. Special characters are converted according to the selected format's rules.
-
Copy the result
Click Copy to copy the output to your clipboard with one click.
String Escape / Unescape FAQ
What is string escaping?
When should I use JSON vs JavaScript escaping?
How is HTML escaping different from URL encoding?
Is my data sent to a server?
What happens if I try to unescape an invalid string?
Can I use this to prevent SQL injection?
Does CSV escaping add the surrounding quotes?
Background
String Escape handles the five most common escaping scenarios developers encounter daily. JSON escaping wraps control characters, quotes, and backslashes in their \n, \t, " equivalents so strings are safe inside JSON payloads. HTML escaping converts &, <, >, ", and ' to their named entities (&, <, >, etc.) to prevent XSS and malformed markup. JavaScript escaping is similar to JSON but also handles single quotes and backticks for template literals. CSV escaping double-quotes fields and escapes internal quotes by doubling them. SQL escaping singles-quotes your string and doubles internal single quotes for safe embedding in queries.
The Unescape direction reverses each operation — paste an escaped string in any format and get the original plain text back. The tool handles numeric HTML entities ({), hexadecimal entities ({), all standard named entities, and malformed sequences are caught and reported clearly.
All processing is client-side using native browser APIs. Nothing is uploaded, logged, or transmitted. Useful for debugging API responses, building SQL queries safely, writing HTML templates, or processing data files.
Related tools
URL Encoder/Decoder
Encode or decode URLs and query string components instantly — supports encodeURIComponent, decodeURIComponent, and full URL encoding.
Base64 Encoder/Decoder
Encode text or files to Base64 or decode Base64 strings back to plain text — real-time, fully in your browser.
JSON Formatter
Format, validate, and minify JSON instantly — with configurable indentation, error location, and tree view.