InfyCalculator
💻

Binary ⇄ Text Converter

Convert text to binary, hexadecimal, decimal, octal or Base64 and back again — with full UTF-8 support for accents, ñ and emoji (plus UTF-16, Latin-1 and ASCII), a character-by-character byte table and auto-detection of pasted code.

Text or code
Mode
Code format
Character encoding
Separate bytes with
Pad every byte to full width (8 bits, 2 hex digits)
Add 0b / 0x / 0o prefixes
Uppercase hex letters
URL-safe Base64 (- and _, no = padding)
Loading calculator…

How it works

text → code: encode each character to bytes (UTF-8: 1 byte for U+0000–007F, 2 bytes up to U+07FF, 3 up to U+FFFF, 4 above), then write each byte in base 2 (8 digits), 16 (2 digits), 10 or 8 — or group the bits in sixes for Base64 · code → text: read each byte back and decode the bytes with the same encoding

Computers store text as numbers: each character maps to one or more bytes (0–255) via an encoding, and each byte is eight binary digits. This converter makes that visible. Encoding runs the text through UTF-8 — so plain letters become a single byte while accented letters such as é and ñ become two bytes and emoji four — and prints each byte as a zero-padded 8-bit group, or as hexadecimal, decimal, octal or Base64 if you prefer; the other formats are listed under the main result so you can copy whichever you need. The table shows every character with its Unicode code point and bytes, and the steps show how UTF-8 spreads a code point’s bits across the 110…, 1110… and 10… bytes. Decoding reverses it: paste bytes separated by spaces or commas (or one unbroken string of 0s and 1s, which is split every 8 bits), with or without 0b / 0x prefixes, and the bytes are turned back into characters. “Auto-detect” recognises binary, hex, decimal and Base64 input by itself. Under More options you can switch to UTF-16, Latin-1 or 7-bit ASCII, change the separator, and turn prefixes, padding and uppercase hex on or off. Invalid input is reported with the offending group rather than silently giving a wrong answer.

Worked example

“Café ☕” has 6 characters but 9 UTF-8 bytes. C, a, f and the space are ASCII, one byte each (C = 67 = 01000011). “é” is U+00E9; its 11 bits 00011 101001 go into two bytes 110|00011 10|101001 = 11000011 10101001 (hex C3 A9). The coffee cup ☕ is U+2615, which needs three bytes: 1110|0010 10|011000 10|010101 = 11100010 10011000 10010101 (E2 98 95). In hex the whole string is 43 61 66 C3 A9 20 E2 98 95 — 9 bytes, 72 bits — and in Base64 it is Q2Fmw6kg4piV. Pasting any of these back with “Code → text” (or Auto-detect) returns “Café ☕”.

Sources: TextEncoder — MDN · RFC 3629 — UTF-8, a transformation format of ISO 10646 · RFC 4648 — The Base16, Base32 and Base64 data encodings

Frequently asked questions

Why is each character 8 bits?

Because one byte is 8 bits, and UTF-8 stores each byte of a character as one byte. A basic ASCII character fits in a single byte (8 bits); characters outside ASCII use two to four bytes, so they produce two to four 8-bit groups in a row.

What happens with emoji or accented letters?

They still work, but produce more than one group. “é” is UTF-8 bytes 195 and 169, giving 11000011 10101001, and an emoji such as 😀 becomes four groups (F0 9F 98 80). Decoding reassembles the consecutive bytes back into the single character.

Why did my binary fail to decode?

Each group must be 0s and 1s worth one byte (up to eight digits), separated by spaces or commas; an unbroken string must have a multiple of 8 digits. A stray character or an extra digit is reported with the group that caused it. If the bytes are valid but not UTF-8, they show as � and a note suggests another encoding.

What is the difference between UTF-8 and ASCII?

ASCII has only 128 characters (English letters, digits, punctuation) stored in 7 bits. UTF-8 is a superset: those same 128 characters keep their one-byte codes, and every other Unicode character uses 2–4 bytes. That is why plain English text gives identical binary in both.

How do I convert text to hexadecimal or Base64?

Choose the code format: hexadecimal writes each byte as two digits (H = 48), and Base64 regroups the bytes into 6-bit pieces written with 64 safe characters, about 33% longer than the raw bytes. The other formats are always listed under the main result as well.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.