UTF-8 Encoding Tool

code
Loading feedback…

Convert text to UTF-8 byte sequences and back. View the hexadecimal, decimal, or binary representation of UTF-8 encoded text. Essential for debugging encoding issues and understanding character encoding.

Last updated: February 4, 2026Author: Mateo DíazReviewed by: Riley Williams
UTF-8 Encoding Tool
In-browser
Encode and decode text using UTF-8
Characters: 0Words: 0Sentences: 0Lines: 0

Options

Characters: 0Words: 0Sentences: 0Lines: 0

What is a UTF-8 encoding tool?

A UTF-8 encoding tool converts text into the byte sequence that represents it in UTF‑8 — and can decode bytes back into text. This is useful when you’re debugging “mojibake” (garbled text), investigating API payloads, or learning how Unicode characters map to bytes.

UTF‑8 is the dominant encoding on the web. A character can take 1–4 bytes depending on what it is (ASCII letters are usually 1 byte; many emoji are 4 bytes).

How to use the UTF-8 encoding tool

  1. Choose a mode: Encode (text → bytes) or Decode (bytes → text).
  2. Pick a byte format: Hex, decimal, binary, or escape sequences.
  3. Paste input and copy output: Copy the byte sequence (or decoded text) for your debugging or code.

Why use this tool?

  • Debug encoding issues: Confirm what bytes you actually have vs what you expected.
  • Inspect non-ASCII characters: See exactly how emoji and accented characters are encoded.
  • Convert bytes back to text: Useful for logs, payload dumps, and binary debugging.

Use case 1: API debugging

If a service rejects text or you see strange characters, encoding to bytes can reveal whether the data was double-encoded or corrupted.

Use case 2: Working with byte dumps

When logs show hex values, decode them back into readable strings to confirm what users actually sent.

Use case 3: Learning and teaching

UTF‑8 examples (hex/decimal/binary) are common in documentation and education. This tool gives you fast, concrete outputs.

Formats explained (hex vs decimal vs binary vs escapes)

The same bytes can be written in different ways. Pick the format that matches what you’re working with:

  • Hex: the most common for debugging protocols and byte dumps (48 65 6C 6C 6F)
  • Decimal: useful when tools/logs show byte values as numbers (72 101 108 108 111)
  • Binary: useful for learning and bit-level debugging (01001000)
  • Escape sequences: useful for code snippets and docs (\\x48\\x65\\x6C...)

Under the hood, they’re all the same bytes — you’re just choosing how to display them.

Encode vs decode (what input this tool expects)

Encode mode

Paste normal text, then choose your output format. You can also set a custom separator for the encoded bytes (for example, a single space, a comma+space, or a newline).

Decode mode

Paste bytes and the tool will decode them into text. Decode mode is forgiving about separators:

  • It accepts spaces or commas between bytes.
  • It can decode hex bytes written as F0 9F 8E 89, 0xF0 0x9F ..., or \\xF0 \\x9F ... (depending on the format you select).

Tip: the “byte separator” option matters for encoding output. Decode mode focuses on parsing byte values from the input (spaces/commas are the safest separators).

Common debugging scenarios (fast workflows)

Scenario 1: “Mojibake” (garbled text)

If you see weird sequences like é instead of é, the bytes were likely decoded using the wrong character set somewhere. Use this tool to:

  1. Encode the “intended” character (like é) and note the bytes (C3 A9 in UTF‑8).
  2. Compare that to what your system actually produced or logged.

Scenario 2: Emoji and multi-byte characters

Emoji are typically 4 bytes in UTF‑8. If you’re debugging a database field, API gateway, or log pipeline, encoding the emoji helps you confirm exactly what was transmitted.

Scenario 3: You have a hex dump and need the original text

Switch to decode mode, choose hex, paste the bytes (spaces or commas), and you’ll get the decoded string.

Examples

Basic example (encode to hex)

Settings: Mode = Encode, Format = Hex
Input: Hello
Output: 48 65 6C 6C 6F

Advanced example (decode from hex)

Settings: Mode = Decode, Format = Hex
Input: F0 9F 8E 89
Output: 🎉

Example: Accented characters (UTF‑8 is multi-byte)

Settings: Mode = Encode, Format = Hex
Input: é
Output: C3 A9

Common errors

Wrong format selected

If you paste hex bytes but the tool is set to decimal (or binary), decoding will fail or produce unexpected characters. Match the format to your input.

Bytes aren’t separated correctly

Decode mode expects bytes separated by spaces or commas. If you used a custom separator while encoding, replace it with spaces/commas before decoding.

Invalid byte sequences

Not every byte sequence is valid UTF‑8. If decoding throws an error or results in replacement characters, the input may be incomplete or not actually UTF‑8.

Decode works, but the text is “wrong”

If you get output but it’s not what you expected, the bytes may represent different characters than you think — or you might be looking at bytes from a different encoding entirely. Confirm the source of the bytes (API logs, file encoding, database collation) and try encoding a known test string to compare.

Troubleshooting checklist (fast fixes)

If decode fails or produces unexpected output:

  1. Match the format (hex/decimal/binary/escape) to your input.
  2. Use spaces or commas between bytes. If you used a custom separator when encoding, replace it before decoding.
  3. Check for missing bytes. Multi-byte characters (like emoji) require the full sequence — an incomplete sequence can decode incorrectly.
  4. Try a known sample (48 65 6C 6C 6FHello) to confirm settings are correct.

Tips and proven approaches

  • Use escape sequences (\\xNN) when you need bytes in code or docs.
  • If you’re debugging URL issues, try the URL Encoder/Decoder — URL encoding is different from UTF‑8 bytes.
  • For compact transport of bytes, use Base64 with the Base64 Encoder/Decoder.
  • For learning, start with ASCII text (Hello) to see 1-byte-per-character, then try emoji to see multi-byte sequences.

Related tools

Privacy and security

Encoding/decoding happens locally in your browser. Nothing you paste is uploaded or stored. No account is required.

Frequently Asked Questions
UTF-8 is a character encoding that can represent any Unicode character using 1-4 bytes, and is the dominant encoding for the web.
For debugging encoding issues, understanding how characters are represented in bytes, or working with binary data.
Enter space-separated byte values (in the selected format) to convert them back to text.