String Escape / Unescape
Runs in browserEscape or unescape strings for JSON, HTML, JavaScript, CSV, and SQL — real-time, client-side, zero dependencies.
Last updated 08 Apr 2026
Escape or unescape strings for six different contexts: JSON, HTML, JavaScript, URL, CSV, and SQL. Choose a format, pick a direction, and paste your text — the output updates in real time. All processing runs client-side using native browser APIs with no data sent to any server.
How to use
- 1
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.
- 2
Select a direction
Choose Escape to convert plain text to its escaped form, or Unescape to convert an escaped string back to plain text.
- 3
Paste your input
Type or paste your text into the input panel. The output updates instantly as you type — no button click needed.
- 4
Review the output
The escaped or unescaped result appears in the output panel. Special characters are converted according to the selected format's rules.
- 5
Copy the result
Click Copy to copy the output to your clipboard with one click.
Frequently asked questions
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?
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 (&#123;), hexadecimal entities (&#x7B;), 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.