Skip to main content
Converters

Text Encoding Converter

Convert between UTF-8 text, hex, binary, octal, and decimal byte representations.

No upload — your files never leave your device

  • 100% private
  • Runs in your browser
  • Works offline
  • No sign-up

About Text Encoding

Text Encoding shows the byte-level representation of any string in five encodings side by side: UTF-8 hex, binary, octal, decimal, and the original Unicode code points. Paste a string with emoji, accented Latin, CJK, or RTL scripts and see exactly how many bytes each character occupies. Reverse mode takes a sequence of bytes in any of those notations and reconstructs the original string. It's the tool you reach for when debugging mojibake, building a binary protocol, or reverse-engineering an obscure file format.

  • No uploads
  • Browser-only
  • Works offline
  • 100% free

How it works

  1. 1

    Type or paste text

    Enter any Unicode string in the source box — emoji, RTL scripts and combining marks are all handled correctly via UTF-8.

  2. 2

    Read all encodings

    The output panel shows the bytes as 2-digit hex, 8-digit binary, 3-digit octal, decimal byte values, and the underlying code points (e.g. U+1F600).

  3. 3

    Reverse a byte string

    Switch to Decode mode and paste a hex / binary / decimal sequence — the tool detects the format and rebuilds the original string.

What a text encoding is, and why several exist

Computers store text as numbers. An encoding is the rulebook that maps characters to bytes and back. Unicode assigns every character a number (a code point) — the letter A is U+0041, the euro sign is U+20AC, an emoji has its own — but a code point still has to be written as actual bytes, and that's where encodings differ. UTF-8 is the dominant choice on the web and the sane default for almost everything: it's ASCII-compatible (the first 128 characters are a single byte, identical to plain ASCII) and uses one to four bytes per character as needed.

Older and narrower encodings still turn up. Latin-1 (ISO-8859-1) and Windows-1252 use a single byte per character, which covers Western European languages but nothing beyond — no Greek, Cyrillic, CJK or emoji. UTF-16 uses two or four bytes per character and is common inside Windows and Java internals. Converting between them re-encodes the same characters into a different byte representation; the text doesn't change, the bytes do.

Mojibake — why text turns into garbled symbols

That mess where an accented word becomes a string of garbage characters, or a document is suddenly full of question-mark boxes, has a precise cause: the bytes were written with one encoding and read with another. It's called mojibake. The classic case is UTF-8 text interpreted as Latin-1 — a single accented character that UTF-8 stored as two bytes gets shown as two separate garbage characters, because Latin-1 reads each byte as its own character.

The fix is to read the bytes with the encoding they were actually written in. The bytes themselves are usually intact and recoverable — nothing is lost, it's purely a decoding mismatch — so converting with the correct source encoding restores the original text. The hard part is knowing which encoding produced the file, since a raw byte stream rarely says; try interpreting it as UTF-8 first and the original almost always comes back.

The BOM, and other practical gotchas

  • A BOM (byte order mark) is an optional few bytes at the very start of a file that signal the encoding and, for UTF-16, the byte order. It helps some programs auto-detect encoding — but a UTF-8 BOM can break others (it shows up as stray characters at the top of a file, or upsets tools that expect a bare ASCII first line, like some shell scripts and CSV parsers).
  • UTF-16 has two byte orders (little-endian and big-endian); read the wrong one and every character is scrambled. This is the original reason the BOM exists.
  • ASCII is a subset of UTF-8 — pure ASCII text is already valid UTF-8 with no conversion needed. The trouble only starts at the first non-ASCII character.
  • When you save a file other tools will read, prefer UTF-8 without a BOM unless something specifically requires otherwise. For encoding text for URLs or transport, see URL Encode and Base64.
  • Encoding is not encryption — converting to UTF-16 or Base64 changes how text is represented, not whether it's readable. Anyone can decode it; don't mistake an encoding for a way to hide data.

Frequently asked questions about Text Encoding

  • Why does one character produce four bytes?

    UTF-8 is variable-length: ASCII chars use 1 byte, most European accents 2 bytes, most CJK 3 bytes, and emoji or supplementary-plane characters 4 bytes. The byte-count badge under each character makes this immediately visible — useful when you're sizing database columns or staying under a wire protocol limit.

  • Does it support other encodings like UTF-16 or Latin-1?

    The primary view is UTF-8 because that's what the modern web standardises on. UTF-16 little-endian (the JavaScript native form) is shown alongside as a secondary view. Latin-1 / Windows-1252 conversion can be done in Decode mode by treating each byte as the corresponding code point in the 0–255 range.

  • How does it handle BOMs and zero-width characters?

    Byte-order marks (U+FEFF) and zero-width joiners (U+200D, used in emoji ZWJ sequences and combined family emoji) are preserved and rendered with an explicit label so you can see invisible characters that would otherwise be impossible to spot.

Privacy, offline use, browser support, and pricing questions are answered on the site-wide FAQ.

See all Converters