devpocket.dev

String Escape & Bytes

Escape string literals across languages or convert text to UTF-8 bytes and Unicode code points.

Runs locally
Loading tool…

How to use

Choose String literals to escape or unescape the selected language or data format. Output includes quotes or field wrappers when that format requires them; interpolation markers are protected for JavaScript/TypeScript templates, PHP and Ruby. SQL uses quote doubling, POSIX Shell uses safe quote concatenation, and Regex escapes metacharacters only.

Choose Text ⇄ bytes for UTF-8 Binary, Hex, Decimal or Octal bytes, or direct U+XXXX Unicode code points. Byte decoding is strict UTF-8. For URL components use the related URL encoder; for broader HTML entity conversion use HTML Entities.

FAQ

Does unescape execute JavaScript or other code?

No. Every supported syntax is parsed explicitly. The tool never uses eval or new Function.

What is the difference between UTF-8 bytes and code points?

A code point identifies a Unicode character, while UTF-8 encodes that point as one to four bytes. For example, 🚀 is U+1F680 and UTF-8 F0 9F 9A 80.

Why is POSIX Shell escaping unusual?

A single quote cannot appear inside a POSIX single-quoted string, so the output closes the quote, inserts an escaped quote, then opens it again.

Related tools