Developer tools
Escape and Unescape Strings: JSON, JavaScript, SQL, Regex
Free, no sign-up, works in your browser. Escape text so it fits safely inside a JSON, JavaScript, CSV, SQL, regular expression or XML string, or turn escaped text like \n and \" back into plain text.
For a value inside a JSON string: quotes, backslashes, line breaks and control characters get a backslash.
Everything happens on your device.
How to use the String Escape and Unescape
- Choose Escape or Unescape.
- Pick where the text is going: JSON, JavaScript, CSV, SQL, Regex or XML.
- Paste your text and copy the result.
Frequently asked questions
- What does escaping a string mean?
- Adding marks, usually backslashes, before characters that would otherwise end the string or change its meaning, such as quotes and line breaks.
- JSON or JavaScript?
- JSON allows only a few escapes such as \n, \" and \u00e9. JavaScript also escapes single quotes and backticks and accepts more forms when unescaping.
- Is escaping enough to stop SQL injection?
- No. Use your database library's query parameters in real code. Escaping here is for quick, one-off queries.
- Is my text uploaded?
- No. Everything happens on your device.
- Is String Escape and Unescape free?
- Yes. It's free to use, with no sign-up and nothing to install.
Related tools
- HTML Entity Encoder and DecoderEncode text into HTML entities so it shows safely on a web page, or decode entities like &, é and é back into readable text.
- URL Encode / DecodeEncode text for a URL or decode %20-style percent-encoding back to readable text, as you type. Paste a full link to see its query parameters listed and decoded. Nothing leaves your device.
- JSON FormatterPaste JSON to check that it's valid, then format it with clear indentation or minify it to one line. If something is wrong, you see the line and column of the mistake. Your data stays on your device.
- Regex TesterTest a regular expression against your text and see every match highlighted as you type, with capture groups (named ones too) and a live replace preview. It follows JavaScript regex rules, and a pattern that runs too long is stopped instead of freezing the page.