What does this tool do?
String Escape escapes or unescapes text for JSON strings, HTML entities, URLs, regular expressions, SQL and CSV fields. It is handy for developers and anyone embedding text safely inside a query, web page or config file.
How to use it
- Paste your text into the input area.
- Adjust the options to fit your needs.
- Copy the processed text.
Six escape formats in one place
The tool applies distinct rules per target: JSON escapes quotes and newlines with backslashes, HTML converts & < > " ' to entities, URL uses encodeURIComponent, RegExp prefixes special characters with a backslash, SQL doubles single quotes, and CSV wraps fields containing commas or quotes in double quotes. You see the correct output for each format instantly as you type, with no setup or server round-trip.
Escape and unescape both ways
For JSON, HTML and URL the tool also runs in reverse, turning an escaped string back into its original readable form. One-way formats like SQL, RegExp and CSV offer escaping only, because those transformations cannot be reliably reversed. This lets you decode an escaped string copied from a log file or encode one for pasting into source code.
Frequently asked questions
Which formats can I unescape?
Only JSON, HTML and URL support unescaping. SQL, RegExp and CSV are one-way, so the unescape button is disabled for them.
Is the SQL escaping safe against injection?
It doubles single quotes and escapes backslashes, but you should always use parameterized queries (prepared statements) for real security. This escaping is a quick helper, not a standalone defense.
Does JSON escaping produce a full JSON object?
No, it escapes only the string content without the surrounding quotes. You can paste the output directly inside a JSON string value.
Is String Escape free?
Yes. String Escape and all 300+ tools on MagmaNex are completely free with no signup or account required.
Is my data safe?
Yes. Everything runs locally in your browser. The data you enter is never sent to a server, stored, or shared.
Does it work on mobile?
Yes. String Escape works on phones, tablets and desktops — no app download needed.
🔒 Privacy: everything runs in your browser, your data is never sent to a server.
