Skip to main content
CaseSwitch

UTF-8 Encoder & Decoder

Use the CaseSwitch UTF-8 Encoder & Decoder to see how characters map to UTF-8 bytes (and back). Choose Encode or Decode, pick decimal or hex byte display, and copy the result. Processing stays in this browser.

Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.

Last reviewed: 23 July 2026

Processed locally in your browser. Nothing is sent to a server.

Paste or type text to convert. Output stays empty until there is input.

Character count: 0 · Word count: 0 · Line count: 0

Examples

Encode café (decimal)

Input

café

Output

99 97 102 195 169

Encode café (hex format)

Input

café

Output

63 61 66 c3 a9

Encode Hi

Input

Hi

Output

72 105

Decode decimal bytes to café

Input

99 97 102 195 169

Output

café

Encode a single letter

Input

A

Output

65

How to use

  1. Choose Encode to see bytes, or Decode to rebuild text from a byte list.
  2. For encode, pick decimal or hex display if the UI offers format.
  3. Copy the output. For decode, separate bytes with spaces.

What this tool is for

Mojibake, wrong Content-Type headers, and interview questions all come down to bytes. This page shows UTF-8 code units for a string, or rebuilds text from decimal/hex byte lists. It is not a full iconv for every legacy code page.

How it works

Encode uses `TextEncoder` and prints bytes as decimal (default) or hex pairs. Decode splits on spaces/commas, accepts decimal or `0x`-prefixed hex, and rebuilds a string with `TextDecoder`. Invalid byte values fail with a clear error.

When to use it

Fixing a file that was read as Latin-1, explaining why a database column “looks wrong,” checking emoji byte length, and teaching that characters are not always one byte.

When not to use it

Not a converter for Windows-1252 or Shift-JIS as source encodings. Not a font renderer. For hex dumps of ASCII, the Hex to Text Converter is a close cousin focused on hex pairs.

How it compares to related tools

Hex to Text emphasizes hex dumps. URL Encode percent-encodes for URLs. Base64 packages bytes as ASCII for transport.

Common mistakes

Decoding Windows-1252 bytes as UTF-8 and blaming the tool. Assuming one byte per character. Mixing decimal and hex in one list without separators the parser understands.

Why emoji are longer

UTF-8 uses one to four bytes per code point. Many emoji are four bytes, and ZWJ sequences add more. Byte length is not the same as “number of characters” users see on screen.

Mojibake checklist

If text looks like é instead of é, someone likely interpreted UTF-8 bytes as Latin-1 (or the reverse). Re-encode/decode with the correct pair, or fix the declared charset at the source. This tool shows the UTF-8 truth for a Unicode string in the browser.

Frequently asked questions

Why is an emoji more than one byte?+

UTF-8 uses one to four bytes per code point. Emoji are often four bytes, plus extra points for ZWJ sequences.

Is this the same as Base64?+

No. UTF-8 is a character encoding. Base64 is a binary-to-ASCII transport encoding.

Can I decode hex bytes?+

Yes — use `0x`-prefixed values or switch display/format as the UI allows. Space-separated lists work for decode.

Does this convert Windows-1252 to UTF-8?+

Not as a legacy code-page converter. It works with Unicode text and UTF-8 bytes in the browser.

Is my text uploaded?+

No. Encoding runs in this browser.

Why did é become two bytes?+

In UTF-8, U+00E9 is bytes 195 169 (C3 A9 in hex). That is correct, not corruption.

Does this tool send my payload to CaseSwitch?+

No. Formatting, encoding, and naming conversions for this page run in your browser after load — your sample stays on the device.

Related tools