UTF-8 Encoder/Decoder

Client-sideNo sign-upFree

Encode text into its raw UTF-8 byte representation, or decode a UTF-8 byte sequence back to text.

How this tool works

1

Choose a direction

Encode text into bytes, or decode a byte sequence back into text.

2

Pick hex or decimal

Byte values display and parse as either two-digit hex pairs or plain decimal numbers.

3

Enter your input

Text to encode, or space/comma-separated byte values to decode.

4

Read the result and byte count

The output updates live, along with exactly how many bytes were produced or consumed.

Quick facts

Category
Encoders & Decoders
Best for
Debugging mojibake or verifying exactly how many bytes a character occupies
Text input
✓ 9 bytes
UTF-8 bytes (hex)
43 61 66 c3 a9 20 e2 98 95
In-content slot

About this tool

Encode any text into the raw sequence of bytes UTF-8 actually stores it as, shown as either hex pairs or decimal values, or run the reverse: paste a UTF-8 byte sequence and decode it back into readable text. This operates one level below tools like base64 or URL encoding, which repackage bytes into a different alphabet for safe transport - UTF-8 encoding is the byte representation itself, the thing base64 and percent-encoding are built on top of. That distinction matters when debugging mojibake (garbled text from a charset mismatch), verifying why a multi-byte character like an emoji or accented letter takes up more than one byte, or checking exactly what bytes a string will occupy in a binary protocol or file format. Multi-byte characters are handled correctly using the browser's native TextEncoder and TextDecoder APIs - a character like "é" or "☕" expands to two or three bytes, and the byte count updates live to make that visible. Decoding validates the byte sequence and reports a clear error if it isn't valid UTF-8, rather than silently producing replacement characters. Runs entirely client-side.

Why use this tool

True byte-level representation

Shows the actual UTF-8 bytes, not a repackaged encoding like base64 or percent-encoding.

Correct multi-byte handling

Accented letters, emoji, and other multi-byte characters expand exactly as UTF-8 defines, using the browser's native encoder.

Hex or decimal byte format

Switch between the two most common ways byte values are written in code and protocol docs.

Validates on decode

Malformed or incomplete byte sequences are reported clearly instead of silently producing garbled text.

Frequently asked questions

Base64 and URL/percent-encoding both take a sequence of bytes and repackage them into a restricted character set that's safe to embed in text, JSON, or a URL - and internally, the bytes they're packaging are usually the UTF-8 encoding of a string. This tool shows that underlying UTF-8 byte sequence directly, without any repackaging, which is the more fundamental representation the other encodings are built from.

UTF-8 is a variable-width encoding: ASCII characters (basic English letters, digits, punctuation) take exactly 1 byte, while characters outside that range take 2 to 4 bytes depending on their Unicode code point - an accented letter like "é" typically takes 2 bytes, and many emoji take 4. This is exactly why a string's byte length and its character length are often different numbers.

The decoder runs in strict mode and reports an error naming the sequence as invalid UTF-8, rather than silently substituting replacement characters (�) the way a lenient decoder would. This makes it useful for verifying that a byte sequence is well-formed UTF-8 in the first place, not just for converting valid ones.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools