Text & Writing

How to Escape Special Characters in Strings

Step-by-step guide to escaping and unescaping special characters for JSON, JavaScript, HTML, SQL, and regex using the DevHexLab String Escaper.

Tool Used

String Escaper

Open tool
1

Open the String Escaper

Navigate to /tools/text/string-escaper.

2

Paste the string

Enter the text that contains characters you need to escape, or the escaped string you want to unescape.

3

Choose the escape format

Select the target format: JSON (escapes double quotes and backslashes), JavaScript (escapes for use inside string literals), HTML, SQL, or Regex.

4

Copy the result

Click Copy to grab the correctly escaped string ready to embed in your code or query.

All done!

You are ready to use String Escaper like a pro.

Try it now
All guides