onlineunicodetools logo

Unicode escaper

World's simplest unicode tool

This browser-based utility escapes Unicode data. Anything that you paste or enter in the text area on the left automatically gets escaped on the right. It supports the most popular Unicode encodings (such as UTF-8, UTF-16, UCS-2, UTF-32, and UCS-4) and it works with emoji characters. You can escape Unicode symbols to sequences of bytes or code points and adjust the escape format. Created by encoding gurus from team Browserling.
announcement heads up!
We just launched a new site โ€“ Online Integer Tools โ€“ a collection of utilities for crunching integers. Check it out!
Escape Format
Select byte escape format.
Activate a custom byte format above and enter it here. Use %b for bin, %o for oct, %d for dec, %h for hex, and \b, \o, \d, \h to write literal b, o, d, h letters.
Select code point escape format.
Activate a custom code point format above and enter it here. Use all byte escape codes plus %u for surrogate pairs.
Unicode Encoding
This option group only works with byte escape format. (Because code points don't have an encoding).
Select Unicode data encoding.
Add a Byte Order Mark in UCS2, UCS4, UTF16, and UTF32 encodings.
Case and Separator
Return lowercase bytes and code points.
Return uppercase bytes and code points.
Separate bytes and code points with this character.
Print escaped data in double quotes.
Unicode escaper tool What is a unicode escaper?
This utility converts Unicode characters to Unicode escape sequences. All input symbols and emojis are first converted to bytes or code points and then these values are formatted according to the selected escape format. The byte escape format represents each Unicode character as one or more bytes. The most popular byte escape formats are backslash-escape (for example, \x61), percent-escape (for example, %61), dollar-escape (for example, $61), and curly and angle bracket escape (for example, \x{61} and <61>). Bytes can be printed in binary, octal, decimal, or hexadecimal base and they can be prefixed with "0x" (hex), "o" (octal), or "0b" (binary) base prefixes. The code point escape format represents each Unicode character as a unique code position. The most common code position escape sequences are backslash-u escape "\u" (for example, \u0061), uni-prefix escape "uni" (for example, uni0061), percent-sign escape (for example, %61), and HTML-escape in hex and decimal notations (for example, &#x61; or &#97;). Code points can also use bases 2, 8, 10, and 16. We made a list of the most popular escape formats for bytes and code points and you can select them from the predefined list for quick access. If you can't find an escape format that you need, you can enter it yourself in the "Custom Byte Format" and "Custom Code Point Format" fields by first selecting the "Custom Format" from the predefined list above the fields. To define bytes and code points in the format string, use the percent symbol % followed by one of the letters: "B" (which means insert a byte or code point in the binary base), "O" (octal base), "D" (decimal base), or "H" (hex base). When working with byte sequences, you can select the encoding of input Unicode data in the second column of options. By default, the UTF8 encoding is used but you can also choose UTF16, UTF32, UCS2, and UCS4, and select Big Endian or Little Endian byte order formats, and add a BOM marker. The third column of options allows you to change the text case of the escaped units in the output and adjust the separator between escaped bytes or escaped code points.
Unicode escaper examples Click to use
JavaScript Escape Sequences
In this example, we convert Aristotle's quote written in bold-italic Unicode font to a code point escape sequence that works in JavaScript. In JavaScript, you can define Unicode strings as sequences of backslashes, followed by the "u" character and the code point wrapped in curly brackets. Code points must be 5 digits long and be in hexadecimal base. We output the entire escape sequence surrounded by double quotes and use lower case letters for hex digits. If you paste the output text in JavaScript console, you'll see the original text.
"๐‘ฏ๐’‚๐’‘๐’‘๐’Š๐’๐’†๐’”๐’” ๐’…๐’†๐’‘๐’†๐’๐’…๐’” ๐’–๐’‘๐’๐’ ๐’๐’–๐’“๐’”๐’†๐’๐’—๐’†๐’”." ยฉ ๐‘จ๐’“๐’Š๐’”๐’•๐’๐’•๐’๐’†
"\u{00022}\u{1d46f}\u{1d482}\u{1d491}\u{1d491}\u{1d48a}\u{1d48f}\u{1d486}\u{1d494}\u{1d494}\u{00020}\u{1d485}\u{1d486}\u{1d491}\u{1d486}\u{1d48f}\u{1d485}\u{1d494}\u{00020}\u{1d496}\u{1d491}\u{1d490}\u{1d48f}\u{00020}\u{1d490}\u{1d496}\u{1d493}\u{1d494}\u{1d486}\u{1d48d}\u{1d497}\u{1d486}\u{1d494}\u{0002e}\u{00022}\u{0000a}\u{000a9}\u{00020}\u{1d468}\u{1d493}\u{1d48a}\u{1d494}\u{1d495}\u{1d490}\u{1d495}\u{1d48d}\u{1d486}"
Required options
These options will be used automatically if you select this example.
Select code point escape format.
Return lowercase bytes and code points.
Separate bytes and code points with this character.
Print escaped data in double quotes.
Escape Unicode in Ruby
This example loads a beautifully formatted Unicode text and escapes it to valid Ruby Unicode sequences. In the Ruby programming language, Unicode glyphs are represented in the backslash-u format. This format has the form \uUUUU, where UUUU is either a code point of the glyph or a surrogate pair. To demonstrate more possibilities, we comma-separate individual code positions and print them in lower case.
ยฐโ€ข. โ™ฅ ๐“™๐“พ๐“ผ๐“ฝ ๐“ซ๐“ฎ๐“ต๐“ฒ๐“ฎ๐“ฟ๐“ฎ โ™ฅ .โ€ขยฐ
\u00b0, \u2022, \u002e, \u0020, \u2665, \u0020, \ud835, \udcd9, \ud835, \udcfe, \ud835, \udcfc, \ud835, \udcfd, \u0020, \ud835, \udceb, \ud835, \udcee, \ud835, \udcf5, \ud835, \udcf2, \ud835, \udcee, \ud835, \udcff, \ud835, \udcee, \u0020, \u2665, \u0020, \u002e, \u2022, \u00b0
Required options
These options will be used automatically if you select this example.
Select code point escape format.
Return lowercase bytes and code points.
Separate bytes and code points with this character.
Print escaped data in double quotes.
Family Emojis
This example uses the 0xHH byte format to escape data with Unicode family emojis. The 0xHH format is simply hexadecimal bytes of the input data. As we have selected the UTF8 encoding, it converts emojis and other characters to a sequence of one, two, three, or four bytes per Unicode symbol. Then it adds the hexadecimal prefix "0x" to each byte and displays bytes separated by spaces.
๐Ÿง’ ๐Ÿ‘ฆ โ€“ children ๐Ÿ‘ฉ ๐Ÿ‘จ โ€“ parents ๐Ÿ‘ด ๐Ÿ‘ต โ€“ grandparents
0xf0 0x9f 0xa7 0x92 0x20 0xf0 0x9f 0x91 0xa6 0x20 0xe2 0x80 0x93 0x20 0x63 0x68 0x69 0x6c 0x64 0x72 0x65 0x6e 0x0a 0xf0 0x9f 0x91 0xa9 0x20 0xf0 0x9f 0x91 0xa8 0x20 0xe2 0x80 0x93 0x20 0x70 0x61 0x72 0x65 0x6e 0x74 0x73 0x0a 0xf0 0x9f 0x91 0xb4 0x20 0xf0 0x9f 0x91 0xb5 0x20 0xe2 0x80 0x93 0x20 0x67 0x72 0x61 0x6e 0x64 0x70 0x61 0x72 0x65 0x6e 0x74 0x73
Required options
These options will be used automatically if you select this example.
Select byte escape format.
Select Unicode data encoding.
Return lowercase bytes and code points.
Separate bytes and code points with this character.
Print escaped data in double quotes.
Python Escape Sequence
This example converts a quote by Lao Tzu to a Python escape format. In Python code, Unicode characters can be encoded using a special escape sequence, which is a backslash, an uppercase or lowercase letter "u", followed by eight hex digits. This format is not in the quick format list, so we set it manually as a custom format. To do it, we select the "Custom" entry in the code point list and enter the "\U%HHHHHHHH" in the field below it. Eight "H" letters mean a zero-padded hexadecimal number with length 8 and the symbol "%" means the start of the hexadecimal format.
๐“—๐“ฎ ๐”€๐“ฑ๐“ธ ๐“ฒ๐“ผ ๐“ฌ๐“ธ๐“ท๐“ฝ๐“ฎ๐“ท๐“ฝ๐“ฎ๐“ญ ๐“ฒ๐“ผ ๐“ป๐“ฒ๐“ฌ๐“ฑ. ๐“›๐“ช๐“ธ ๐“ฃ๐”ƒ๐“พ
\U0001D4D7, \U0001D4EE, \U00000020, \U0001D500, \U0001D4F1, \U0001D4F8, \U00000020, \U0001D4F2, \U0001D4FC, \U00000020, \U0001D4EC, \U0001D4F8, \U0001D4F7, \U0001D4FD, \U0001D4EE, \U0001D4F7, \U0001D4FD, \U0001D4EE, \U0001D4ED, \U00000020, \U0001D4F2, \U0001D4FC, \U00000020, \U0001D4FB, \U0001D4F2, \U0001D4EC, \U0001D4F1, \U0000002E, \U00000020, \U0001D4DB, \U0001D4EA, \U0001D4F8, \U00000020, \U0001D4E3, \U0001D503, \U0001D4FE
Required options
These options will be used automatically if you select this example.
Select code point escape format.
Activate a custom code point format above and enter it here. Use all byte escape codes plus %u for surrogate pairs.
Return uppercase bytes and code points.
Separate bytes and code points with this character.
Print escaped data in double quotes.
Funny Unicode Face
In this example, we encode a funny Unicode face as a binary bit sequence. Each byte in the sequence has a length of 8 bits and we also add the binary prefix "0b" before each byte. As we're using the UTF-16 Unicode encoding with the Little Endian byte order format, each Unicode character has two or four bytes. The output is formatted so that each escape unit is printed on a new line.
โ™ช(เน‘แด–โ—กแด–เน‘)โ™ช
0b01101010 0b00100110 0b00101000 0b00000000 0b01010001 0b00001110 0b00010110 0b00011101 0b11100001 0b00100101 0b00010110 0b00011101 0b01010001 0b00001110 0b00101001 0b00000000 0b01101010 0b00100110
Required options
These options will be used automatically if you select this example.
Select byte escape format.
Select Unicode data encoding.
Add a Byte Order Mark in UCS2, UCS4, UTF16, and UTF32 encodings.
Return lowercase bytes and code points.
Separate bytes and code points with this character.
Print escaped data in double quotes.
Dragons and Dinosaurs
In this example, we use the "Escaped Octal Bytes" format to print dragon and dinosaur emojis as octal numbers. We treat the emoticons as UCS-4 Big Endian data (which is the same as UTF-32 Big Endian) and add the Byte Order Mark (BOM) in front of the data. In the output, we get a series of backslash-escaped semicolon-separated octets.
๐Ÿ‰ โ€“ dragon ๐Ÿฆ• โ€“ sauropod ๐Ÿฆ– โ€“ t-rex
\000; \000; \376; \377; \000; \001; \364; \011; \000; \000; \000; \040; \000; \000; \040; \023; \000; \000; \000; \040; \000; \000; \000; \144; \000; \000; \000; \162; \000; \000; \000; \141; \000; \000; \000; \147; \000; \000; \000; \157; \000; \000; \000; \156; \000; \000; \000; \012; \000; \001; \371; \225; \000; \000; \000; \040; \000; \000; \040; \023; \000; \000; \000; \040; \000; \000; \000; \163; \000; \000; \000; \141; \000; \000; \000; \165; \000; \000; \000; \162; \000; \000; \000; \157; \000; \000; \000; \160; \000; \000; \000; \157; \000; \000; \000; \144; \000; \000; \000; \012; \000; \001; \371; \226; \000; \000; \000; \040; \000; \000; \040; \023; \000; \000; \000; \040; \000; \000; \000; \164; \000; \000; \000; \055; \000; \000; \000; \162; \000; \000; \000; \145; \000; \000; \000; \170
Required options
These options will be used automatically if you select this example.
Select byte escape format.
Select Unicode data encoding.
Add a Byte Order Mark in UCS2, UCS4, UTF16, and UTF32 encodings.
Return lowercase bytes and code points.
Separate bytes and code points with this character.
Print escaped data in double quotes.
Pro tips Master online unicode tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlineunicodetools.com/escape-unicode?input=%22%F0%9D%91%AF%F0%9D%92%82%F0%9D%92%91%F0%9D%92%91%F0%9D%92%8A%F0%9D%92%8F%F0%9D%92%86%F0%9D%92%94%F0%9D%92%94%20%F0%9D%92%85%F0%9D%92%86%F0%9D%92%91%F0%9D%92%86%F0%9D%92%8F%F0%9D%92%85%F0%9D%92%94%20%F0%9D%92%96%F0%9D%92%91%F0%9D%92%90%F0%9D%92%8F%20%F0%9D%92%90%F0%9D%92%96%F0%9D%92%93%F0%9D%92%94%F0%9D%92%86%F0%9D%92%8D%F0%9D%92%97%F0%9D%92%86%F0%9D%92%94.%22%0A%C2%A9%20%F0%9D%91%A8%F0%9D%92%93%F0%9D%92%8A%F0%9D%92%94%F0%9D%92%95%F0%9D%92%90%F0%9D%92%95%F0%9D%92%8D%F0%9D%92%86&use-code-point=true&code-point-format=u-prefixed-curly-code-points&lowercase=true&separator=&wrap-in-quotes=true
All unicode tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly find code positions of all Unicode values.
Quickly decode code positions to Unicode values.
Quickly encode Unicode values to UTF-8 encoding.
Quickly encode Unicode values to UTF-16 encoding.
Quickly encode Unicode values to UTF-32 encoding.
Quickly create a picture from Unicode symbols.
Quickly generate random Unicode text in a given range.
Quickly generate all Unicode values from the given code point interval.
Quickly filter Unicode symbols that are within the given code point interval.
Quickly split Unicode data into graphemes.
Quickly sort Unicode glyphs in increasing or decreasing order.
Quickly find the length of Unicode text.
Quickly increase Unicode code point values.
Quickly decrease Unicode code point values.
Quickly reverse the order of symbols in Unicode text.
Quickly rotate Unicode characters to the left and right.
Quickly create multiple copies of Unicode text.
Quickly extract all characters from Unicode text.
Quickly split Unicode data into pieces.
Quickly split Unicode text into chunks of constant length.
Quickly merge Unicode snippets together.
Quickly shorten Unicode text to the given length.
Quickly left-pad Unicode text with any character.
Quickly right-pad Unicode text with any character.
Quickly align Unicode data to the center.
Quickly align Unicode data to the right.
Quickly convert ordinary numbers to fancy Unicode numbers.
Quickly convert Unicode numbers back to regular numbers.
Quickly convert ordinary letters to Unicode letters in various fonts.
Quickly convert Unicode letters back to regular Latin letters.
Quickly convert ordinary text to fancy Unicode text.
Quickly convert fancy Unicode text back to regular text.
Quickly combine input Unicode with diacritical marks.
Quickly delete diacritical marks from the Unicode text.
Quickly spoof regular text using Unicode homoglyphs.
Quickly circularly rearrange Unicode symbols.
Quickly convert Unicode data to escape sequences.
Quickly encode Unicode data to HTML entities.
Quickly URL-escape Unicode symbols.
Quickly encode Unicode values to base64.
Quickly encode Unicode values to a data URI.
Quickly convert Unicode characters to raw bytes.
Quickly convert Unicode data to base-2 (binary).
Quickly convert Unicode data to base-8 (octal).
Quickly convert Unicode data to base-10 (decimal).
Quickly convert Unicode data to base-16 (hexadecimal).
Quickly convert Unicode symbols to raw ASCII bytes.
Quickly convert ASCII bytes to Unicode symbols.
Quickly convert Unicode text to a string literal.
Quickly create a picture from Unicode emojis.
Quickly release Zalgo on your Unicode text.
Quickly make Zalgo text readable again.
Coming soon These unicode tools are on the way
Name Unicode Symbols
Spell out the names of Unicode characters in the input text.
URL-decode Unicode
URL-unescape Unicode text.
Convert Binary to Unicode
Convert base-2 data to Unicode encoding.
Convert Octal to Unicode
Convert base-8 data to Unicode encoding.
Convert Decimal to Unicode
Convert base-10 data to Unicode encoding.
Convert Hex to Unicode
Convert base-16 data to Unicode encoding.
Convert Unicode to Any Base
Convert Unicode text to any radix.
Convert Any Base to Unicode
Convert any radix data to Unicode.
Convert Unicode to Latin1
Convert Unicode text to Latin1 encoding.
Convert Latin1 to Unicode
Convert Latin1 encoded data to Unicode.
Convert Bytes to Unicode
Convert raw bytes to Unicode.
Validate Unicode
Check if the given Unicode has valid encoding.
Convert Unicode to Punycode
Encode Unicode text to Punycode encoding.
Convert Punycode to Unicode
Decode Punycode encoding to Unicode.
Decode Base64 to Unicode
Convert base64 data to Unicode text.
Encode Unicode to Data URI
Convert Unicode to a valid data URL.
Decode Data URI to Unicode
Convert a valid data URL to Unicode text.
Convert HTML to Unicode
Decode HTML entities to Unicode data.
Convert UTF8 to Unicode
Decode UTF8 encoding to Unicode.
Convert UTF16 to Unicode
Decode UTF16 encoding to Unicode.
Convert UTF32 to Unicode
Decode UTF32 encoding to Unicode.
Convert Unicode to Uppercase
Convert all Unicode characters to uppercase.
Convert Unicode to Lowercase
Convert all Unicode characters to lowercase.
Convert Unicode to Randomcase
Randomize case of all Unicode characters.
Convert Unicode to Lowercase
Convert all Unicode characters to lowercase.
JSON Stringify Unicode
Encode Unicode to JSON.
JSON Parse Unicode
Decode JSON to Unicode.
Shuffle Unicode Symbols
Randomly rearrange the order of input graphemes.
Convert Unicode to Alt Code
Generate Alt codes for Unicode characters.
Convert Alt Code to Unicode
Generate Unicode glyphs from Alt codes.
Analyze Unicode
Print statistics about Unicode data and code points, etc.
Slice Unicode
Extract a part from Unicode data.
Generate Unicode Waves
Draw waves with Unicode symbols.