Dev · 108 tools · nothing uploads

String escape / unescape

Escape or unescape a string for JSON, JavaScript, HTML, URL, SQL, shell, regex or CSV, each with its own table of rules. Runs on your device.

Options

live

String escape / unescape runs one of eight language tables, html, url, sql, shell, regex, csv, json or js, against the typed text in either direction. Each table follows its own rule: shell wraps the string in single quotes, sql doubles an internal quote, json calls JSON.stringify or JSON.parse. You pick lang yourself, so pairing the wrong two silently comes back garbled.

Questions

Which languages are supported?

JSON, JavaScript, HTML, URL, SQL, shell, regex and CSV, each with its own escape and unescape table.

How does shell escaping work?

It wraps the whole string in single quotes, ending and reopening the quote around any literal single quote inside it.

Does it auto-detect the language?

No, you pick lang yourself; escaping for one language and unescaping with another produces the wrong result silently.

What does the JSON mode use?

JSON.stringify to escape and JSON.parse to unescape, wrapped in quotes internally.

What happens with invalid escaped input?

JSON unescape and URL unescape refuse with the underlying parser's error; other languages simply pass unmatched sequences through.

Compare

ToolRuns on the CLILive as you type
String escape / unescapeYesYes
MIME type lookupYesYes
HTTP status referenceYesYes
User-agent parserYesYes
Regex tester + explainerYesYes
docker run → composeYesYes
URL parserYesYes

Related Dev tools