Unicode to UTF-8, UTF-16 & UTF-32 Converter

Turn any text into its UTF byte sequence in the base you want.

Unicode to UTF-8, UTF-16 & UTF-32 Converter

Unicode to UTF Converter encodes every character of your text as a UTF-8, UTF-16 or UTF-32 byte sequence.
Choose the numeral base, byte order, BOM, delimiter, prefix and padding. Then copy or download the result.


Load an example

Settings

UTF-8 is byte-oriented; UTF-16 and UTF-32 use code units and have a byte order.

How each 8-bit byte is written; digits above 9 use A–Z.

Text placed between bytes. A dash is the default.

Tag bytes with their base, pad to full width, and prepend a byte order mark.

0 characters · 0 code points · 0 bytes · UTF-8
Ready to encode Unicode text.


Overview:

The Unicode to UTF Converter is a free, browser-based tool that turns readable text into the raw UTF-8, UTF-16 or UTF-32 byte values that computers actually store. Type or paste your text, pick an encoding, and the tool immediately prints each byte as binary, octal, decimal, hexadecimal or any base from 2 to 36. It shows exactly what happens under the hood when a file, database or network message saves your words.

It is useful whenever you need to inspect or reproduce byte-level data: debugging a mojibake problem, checking how many bytes an emoji really costs, writing a serialization routine, documenting an API payload, or proving that two strings that look identical are stored differently. Because every script on Earth is covered, you can test accented Latin, Cyrillic, Arabic, CJK and emoji in the same run.

The page is written in plain HTML, CSS and JavaScript, and the encoders are implemented directly from the Unicode Standard, so there is no server, no upload and no third-party library. UTF-8, UTF-16 (including surrogate pairs and byte order) and UTF-32 are all calculated inside your browser, so your text never leaves your device.


What Are UTF-8, UTF-16 and UTF-32?

Unicode assigns every character a number called a code point, written like U+0041 for the letter A. A Unicode Transformation Format (UTF) is simply a rule for turning those numbers into bytes. The number in the name describes the size of the code unit it works with, not a fixed character size.

UTF-8 uses 8-bit units and is the dominant encoding on the web. A code point below 128 becomes one byte; larger code points become two, three or four bytes. Because plain ASCII text stays one byte per character, UTF-8 is compact for English and still supports every symbol. This is why Café is four characters but five UTF-8 bytes.

UTF-16 uses 16-bit units. Most common characters fit in one unit, and characters above U+FFFF (many emoji and rare scripts) are stored as a surrogate pair of two units, which is four bytes. UTF-16 also has a byte order, so big-endian and little-endian versions differ, and a byte order mark (BOM) is often used to signal which one is in play.

UTF-32 uses 32-bit units, so every code point takes exactly four bytes. It is simple and fixed-width, which makes random access easy, but it uses far more space than UTF-8 and is rarely chosen for storage or transfer.


What This Tool Does

The tool walks your input one code point at a time, applies the UTF rule you selected, and then writes each resulting 8-bit byte in the numeral base you chose. Spaces, punctuation, letters, digits, symbols and emoji are all handled; accented characters and emoji are never split into the wrong number of pieces, even when they are made of surrogate pairs.

Every option is a small, independent switch. You can, for example, output UTF-16 big-endian bytes in hexadecimal with a BOM for a Windows API, or the same text as UTF-8 binary without padding for a teaching slide. The Load an example link and the buttons in the Examples section preset the encoding and options for you, and the statistics line reports the character, code point and byte counts for the current setting.


Features

Three encodings in one place: Switch between UTF-8, UTF-16 and UTF-32 from a single dropdown instead of opening separate tools. The statistics line and the output update the moment you change it.

Example: the word Go is 47 6F in UTF-8 (one byte each), 00 47 00 6F in UTF-16 big-endian, and 00 00 00 47 00 00 00 6F in UTF-32 big-endian.

Byte order (UTF-16 and UTF-32): Big-endian stores the most significant byte first, little-endian stores it last. The byte order selector appears only when it matters, so you cannot set it by accident for UTF-8, which is byte-oriented and has no endianness.

Example: the letter A is 00 41 big-endian and 41 00 little-endian in UTF-16.

Optional BOM: Ticking Add BOM prepends the correct byte order mark for the chosen encoding and endianness: EF BB BF for UTF-8, FE FF or FF FE for UTF-16, and 00 00 FE FF or FF FE 00 00 for UTF-32. Signalling the encoding this way is useful when a reader has no other hint.

Example: Hi in UTF-16 big-endian with a BOM starts FE FF 00 48 00 69.

Output base: Render each byte as binary, octal, decimal, hexadecimal, or any base from 2 to 36. Bases above 10 use the letters A to Z for the extra digits, exactly like hexadecimal uses A to F.

Example: byte 255 prints as 11111111 in binary, 377 in octal, 255 in decimal and FF in hexadecimal.

Byte delimiter: Set any separator between bytes. A dash is the default and keeps values easy to read; a space, a comma, a newline or no separator at all suit code, spreadsheets or a specific parser.

Example: the first two bytes of OK become 4F-4B by default, and 4F, 4B with a comma and a space.

Prefix and zero-padding: Add prefix tags each byte as 0b, 0o or 0x for binary, octal and hexadecimal so the base is unambiguous. Add zero-padding pads every byte to the full width of the base (eight digits for binary, three for octal and decimal, two for hexadecimal and base-36), so all values line up.

Example: the byte 7 becomes 00000111 in padded binary and 07 in padded hexadecimal.

Live conversion and statistics: The output is produced as you type or whenever an option changes, and the statistics line reports characters, code points and total bytes (including any BOM). Grapheme counting means combined emoji sequences are not over-counted.

File upload, copy, download and clear: Load a .txt file instead of typing, copy the result with one click, download it as a file, or clear both boxes to start over.


Examples:

Click Try it on any example to load it into the tool. Each example also switches on the encoding and options it demonstrates, and the text on the right is the exact output the tool produces with those settings.

Example 1: A sea-life emoji and word list in UTF-8
Input
🐙 Octopus
🐬 Dolphin
🦀 Crab
Output (UTF-8, hexadecimal, dash delimiter)
F0-9F-90-99-20-4F-63-74-6F-70-75-73-0A-F0-9F-90-AC-20-44-6F-6C-70-68-69-6E-0A-F0-9F-A6-80-20-43-72-61-62

Each animal emoji takes four UTF-8 bytes, the letters and spaces take one byte each, and every line break becomes 0A. A small list of real Unicode text shows how the bytes add up.

Example 2: An emoji in binary with a prefix and comma delimiter
Input
OK 👍
Output (UTF-8, binary, 0b prefix, ", " delimiter)
0b01001111, 0b01001011, 0b00100000, 0b11110000, 0b10011111, 0b10010001, 0b10001101

The letters O and K and the space are one byte each; the thumbs-up emoji (U+1F44D) is four bytes, shown here padded to eight binary digits with a 0b prefix.

Example 3: A sky emoji and word list in UTF-16 big-endian with a BOM
Input
🌟 Star
🌙 Moon
☄ Comet
Output (UTF-16 big-endian, hexadecimal, with BOM)
FE-FF-D8-3C-DF-1F-00-20-00-53-00-74-00-61-00-72-00-0A-D8-3C-DF-19-00-20-00-4D-00-6F-00-6F-00-6E-00-0A-26-04-00-20-00-43-00-6F-00-6D-00-65-00-74

The BOM FE FF marks big-endian UTF-16. The star and moon are above U+FFFF, so each becomes a surrogate pair (D8 3C DF 1F and D8 3C DF 19), while the comet (U+2604), the letters, the spaces and each line break fit in a single 16-bit unit.

Example 4: Accented text and an emoji in UTF-32 little-endian with a BOM
Input
Café 🌍
Output (UTF-32 little-endian, hexadecimal, with BOM)
FF-FE-00-00-43-00-00-00-61-00-00-00-66-00-00-00-E9-00-00-00-20-00-00-00-0D-F3-01-00

The BOM FF FE 00 00 marks little-endian UTF-32. Every character, whether a plain letter, an accented é or the globe emoji, takes exactly four bytes with the least significant byte first.

Example 5: An accented word in decimal (UTF-8)
Input
naïve
Output (UTF-8, decimal, padded)
110-097-195-175-118-101

In decimal the pattern is easy to see: the plain letters sit in the nineties and low hundreds, while the single accented ï (U+00EF) splits into the two UTF-8 bytes 195 and 175.


Reference Table: English Alphanumerics

The table lists every English letter and digit with its code point and its UTF-8, UTF-16 and UTF-32 byte values in hexadecimal. Because these characters all sit below U+0080, UTF-8 uses a single byte for each, UTF-16 stores each in one 16-bit unit and UTF-32 stores each in one 32-bit unit. The UTF-16 and UTF-32 columns are shown in big-endian order.

Character Code point UTF-8 (hex) UTF-16 BE (hex) UTF-32 BE (hex)
A U+0041 41 00 41 00 00 00 41
B U+0042 42 00 42 00 00 00 42
C U+0043 43 00 43 00 00 00 43
D U+0044 44 00 44 00 00 00 44
E U+0045 45 00 45 00 00 00 45
F U+0046 46 00 46 00 00 00 46
G U+0047 47 00 47 00 00 00 47
H U+0048 48 00 48 00 00 00 48
I U+0049 49 00 49 00 00 00 49
J U+004A 4A 00 4A 00 00 00 4A
K U+004B 4B 00 4B 00 00 00 4B
L U+004C 4C 00 4C 00 00 00 4C
M U+004D 4D 00 4D 00 00 00 4D
N U+004E 4E 00 4E 00 00 00 4E
O U+004F 4F 00 4F 00 00 00 4F
P U+0050 50 00 50 00 00 00 50
Q U+0051 51 00 51 00 00 00 51
R U+0052 52 00 52 00 00 00 52
S U+0053 53 00 53 00 00 00 53
T U+0054 54 00 54 00 00 00 54
U U+0055 55 00 55 00 00 00 55
V U+0056 56 00 56 00 00 00 56
W U+0057 57 00 57 00 00 00 57
X U+0058 58 00 58 00 00 00 58
Y U+0059 59 00 59 00 00 00 59
Z U+005A 5A 00 5A 00 00 00 5A
a U+0061 61 00 61 00 00 00 61
b U+0062 62 00 62 00 00 00 62
c U+0063 63 00 63 00 00 00 63
d U+0064 64 00 64 00 00 00 64
e U+0065 65 00 65 00 00 00 65
f U+0066 66 00 66 00 00 00 66
g U+0067 67 00 67 00 00 00 67
h U+0068 68 00 68 00 00 00 68
i U+0069 69 00 69 00 00 00 69
j U+006A 6A 00 6A 00 00 00 6A
k U+006B 6B 00 6B 00 00 00 6B
l U+006C 6C 00 6C 00 00 00 6C
m U+006D 6D 00 6D 00 00 00 6D
n U+006E 6E 00 6E 00 00 00 6E
o U+006F 6F 00 6F 00 00 00 6F
p U+0070 70 00 70 00 00 00 70
q U+0071 71 00 71 00 00 00 71
r U+0072 72 00 72 00 00 00 72
s U+0073 73 00 73 00 00 00 73
t U+0074 74 00 74 00 00 00 74
u U+0075 75 00 75 00 00 00 75
v U+0076 76 00 76 00 00 00 76
w U+0077 77 00 77 00 00 00 77
x U+0078 78 00 78 00 00 00 78
y U+0079 79 00 79 00 00 00 79
z U+007A 7A 00 7A 00 00 00 7A
0 U+0030 30 00 30 00 00 00 30
1 U+0031 31 00 31 00 00 00 31
2 U+0032 32 00 32 00 00 00 32
3 U+0033 33 00 33 00 00 00 33
4 U+0034 34 00 34 00 00 00 34
5 U+0035 35 00 35 00 00 00 35
6 U+0036 36 00 36 00 00 00 36
7 U+0037 37 00 37 00 00 00 37
8 U+0038 38 00 38 00 00 00 38
9 U+0039 39 00 39 00 00 00 39

FAQs

FAQ 1: What does "Unicode to UTF-8" actually mean?
Answer: Unicode assigns each character a code point number. Converting to UTF-8 means turning those code point numbers into the specific byte sequence UTF-8 defines. The same idea applies to UTF-16 and UTF-32; only the byte pattern changes, the underlying code points stay the same.

FAQ 2: Which encoding should I choose?
Answer: Use UTF-8 for almost anything web, file or network related; it is the standard on the web and stays compact for Latin text. Choose UTF-16 when an API, Windows call or a specific file format asks for it, and UTF-32 when a fixed four-byte width makes indexing simpler. If a target system specifies an encoding, follow its documentation.

FAQ 3: Why do some characters turn into more than one byte?
Answer: The UTF formats are variable length for anything above ASCII. In UTF-8 a code point above U+007F needs two, three or four bytes, and in UTF-16 a code point above U+FFFF is stored as a surrogate pair of two 16-bit units. That is normal and correct, because it is how a single character can cost several bytes.

FAQ 4: What is a BOM, and should I add one?
Answer: A BOM (byte order mark) is a short signature at the start of the data that tells a reader the encoding and, for UTF-16 and UTF-32, the byte order. Add it when a consuming program expects one or when the encoding would otherwise be unclear. For UTF-8 on the web it is usually best left off, because the HTTP header or HTML meta tag already declares the encoding.

FAQ 5: Which byte order should I pick for UTF-16 or UTF-32?
Answer: Byte order is a storage detail, not a different encoding. Big-endian writes the most significant byte first and is common in network protocols, while little-endian is typical on x86 and in Windows. If the system that will read the bytes expects either one, follow its documentation; a BOM can also record the choice for you.

FAQ 6: Is my text uploaded to a server?
Answer: No. All encoding runs in your browser using plain JavaScript, so your text never leaves your device. There is no server-side processing and nothing is stored.


Tools Worth Trying

TextToolz

The Ultimate Text Tools

TextToolz works seamlessly to let you convert and design your text. It is fast, reliable and secure. Trusted by thousands of users.