UTF-8 Encoder and Decoder

Encode Unicode text as UTF-8 bytes, or decode and validate byte sequences as strict UTF-8 text.

Choose the byte format explicitly because hexadecimal, decimal, binary, and prefixed byte syntax follow different parsing rules.

Your input is processed in this browser and is not submitted to UnicodeNow.

Processed locally in your browser

Encode uses Unicode text → optional normalization → UTF-8 bytes → selected byte format. Decode uses selected byte representation → parsed bytes → strict UTF-8 validation → Unicode text. For U+ notation, use Unicode Code Points to Text.

Operation

Continuous hexadecimal forces no separator. \x output can use no separator safely.

Advanced options

Normalization changes the Unicode sequence before UTF-8 encoding and therefore changes the byte output.

Output represents UTF-8 bytes, not Unicode code-point notation.

UTF-8 diagnostics

CharacterCode pointUTF-8 bytesByte count

What this UTF-8 tool does

This tool works in two directions. Encode mode turns Unicode text into UTF-8 bytes and formats those bytes as hexadecimal, decimal, binary, 0x-prefixed, or \x-prefixed values. Decode mode parses a selected byte representation, validates the bytes as strict UTF-8, and returns Unicode text. The page runs locally in your browser.

The byte layer is explicit. A JavaScript string is not a byte array, and a byte dump is not automatically text. This page keeps those steps separate so malformed byte syntax, malformed UTF-8, optional BOM handling, and Unicode normalization can be diagnosed without guessing.

Unicode vs UTF-8

Unicode defines abstract code points such as U+0041, U+00E9, and U+1F600. UTF-8 is one way to encode those code points as bytes. ASCII code points use one byte, many Latin, Greek, and Cyrillic characters use two, many CJK characters and symbols use three, and supplementary characters such as many emoji use four.

That means character counts and byte counts are different questions. é is one Unicode code point but two UTF-8 bytes. 😀 is one code point but four UTF-8 bytes. A grapheme cluster such as a family emoji or a combining sequence may contain several code points and therefore many bytes.

How many bytes UTF-8 uses

Character rangeTypical byte length
ASCII1
Many Latin, Greek, Cyrillic2
Many CJK characters and symbols3
Supplementary characters and many emoji4

UTF-8 examples

TextCode pointUTF-8 bytes
AU+004141
éU+00E9C3 A9
U+20ACE2 82 AC
ЖU+0416D0 96
U+4E2DE4 B8 AD
😀U+1F600F0 9F 98 80

Valid and invalid UTF-8

UTF-8 uses leading bytes and continuation bytes. A continuation byte is in the range 80 through BF. Invalid data can contain a leading byte without enough continuations, a continuation byte where a leading byte is required, an overlong encoding, a surrogate-range encoding, or a four-byte sequence above U+10FFFF. Decode mode reports byte offsets using one-based positions.

Examples such as C3, C3 28, A0 A1, ED A0 80, and F4 90 80 80 are rejected in UTF-8 text mode. Byte inspection mode still shows the parsed bytes when byte syntax is valid but the bytes are not text.

Supported byte formats

48 65 6C
48656C
72 101 108
01001000 01100101
0x48 0x65
\x48\x65

Auto-detect accepts clear input and reports ambiguity when the same text could mean more than one byte format. Choose the format explicitly for copied byte dumps, especially when values contain only digits.

UTF-8 BOM

The UTF-8 BOM is the byte sequence EF BB BF. It is optional in UTF-8 and is not normally required. Encode mode can add it only when you select that option. Decode mode can report and preserve a leading U+FEFF, remove it, or reject it. The same bytes in the middle of input are treated as text data, not as a BOM.

Unicode normalization

Normalization is separate from UTF-8 validity. With normalization off, é encodes as C3 A9, while e plus U+0301 encodes as 65 CC 81. If you choose NFC before encoding, the decomposed sequence may become the precomposed character and produce different bytes.

Binary data vs UTF-8 text

Valid byte syntax may represent images, PDFs, ZIP data, protocol messages, or text in another encoding. That data can be useful but not valid UTF-8. Use byte inspection when you need to inspect bytes without interpreting them as Unicode text.

How to use the tool

  1. Choose Encode or Decode.
  2. For Encode, enter text and choose an output byte format, separator, casing, normalization, and optional BOM.
  3. For Decode, paste bytes, choose the byte input format, output mode, and BOM behavior.
  4. Use Auto-detect only for clear byte formats; choose explicitly when the page reports ambiguity.
  5. Review statistics, warnings, and diagnostics before copying or downloading.

Privacy and processing

This tool runs in your browser. Your input is not submitted to UnicodeNow. The output is written as textarea text, and downloads use Blob URLs that are revoked after use.

Common uses

Example

Input text:

Hello, café 😀

UTF-8 hex:

48 65 6C 6C 6F 2C 20 63 61 66 C3 A9 20 F0 9F 98 80

UTF-8 bytes:

48 65 6C 6C 6F

Decoded text:

Hello

Frequently asked questions

What is UTF-8?

UTF-8 is a variable-length encoding for Unicode code points.

What is the difference between Unicode and UTF-8?

Unicode defines code points; UTF-8 encodes those code points as bytes.

How many bytes does UTF-8 use?

UTF-8 uses one to four bytes per Unicode code point.

Why does é use two bytes?

Because U+00E9 is encoded as C3 A9 in UTF-8.

Why does emoji use four bytes?

Many emoji are supplementary Unicode code points, and supplementary code points use four UTF-8 bytes.

What is a continuation byte?

A continuation byte is a byte in the range 80 through BF that continues a multi-byte UTF-8 sequence.

What is an overlong UTF-8 sequence?

It is a longer-than-necessary byte sequence for a code point, and it is invalid UTF-8.

Why can valid bytes fail as UTF-8?

The bytes may represent binary data, another encoding, or malformed UTF-8.

What is a UTF-8 BOM?

A UTF-8 BOM is the optional leading byte sequence EF BB BF.

Does normalization change UTF-8 bytes?

It can, because normalization may change the Unicode sequence before encoding.

Can this tool decode binary files?

It can inspect bytes, but arbitrary binary data may not be valid UTF-8 text.

What happens with an unpaired surrogate?

Encoding is rejected rather than silently replacing it.

Does Decode mode insert replacement characters?

No. Strict decoding reports malformed UTF-8 instead of silently inserting U+FFFD.

Is my input uploaded?

No. This tool runs in your browser and does not submit input to UnicodeNow.

Related tools

Text to Hex

Convert UTF-8 text bytes into hexadecimal values.

EncodingProcessed locally

Hex to Text

Decode hexadecimal byte values into UTF-8 text.

EncodingProcessed locally

Text to Binary

Convert UTF-8 text bytes into binary byte groups.

EncodingProcessed locally

Binary to Text

Decode binary byte groups into UTF-8 text.

EncodingProcessed locally

Text to Decimal

Convert text to decimal byte values or Unicode code points.

EncodingProcessed locally

Decimal to Text

Convert decimal bytes or Unicode code point values to text.

EncodingProcessed locally

Byte Length Calculator

Count UTF-8 bytes, code points, grapheme clusters and UTF-16 code units for text.

EncodingProcessed locally

Unicode Character Inspector

Inspect each Unicode character, encoding, category, script and normalization form.

UnicodeProcessed locally

Unicode Sequence Analyzer

Analyze code points, grapheme clusters, bytes, scripts and directionality.

UnicodeProcessed locally

Related guides

Unicode vs UTF-8

Unicode defines characters and code points. UTF-8 encodes those code points as bytes for files, databases, web pages, APIs and network messages.

What Is a Unicode Code Point?

Learn what Unicode code points are, how U+ notation works, and how code points differ from glyphs, bytes, code units and visible characters.

Unicode Normalization Explained

Learn NFC, NFD, NFKC and NFKD, canonical and compatibility equivalence, and safe normalization for comparison, search and identifiers.

How to Fix Broken UTF-8 Text

A safe workflow for diagnosing broken UTF-8, validating bytes, reversing mojibake, handling double encoding and auditing repairs.