Skip to content

Binary translator: text to binary, binary to text, hex and octal

A binary translator converts text into the 0s and 1s a computer stores. Each character is mapped to a number using a character encoding (ASCII for basic Latin text, UTF-8 for everything else) and that number is written in base 2, usually padded to 8 bits, so “A” becomes 01000001. To decode, split the binary into 8-bit groups and map each back to a character. This tool converts in both directions and also shows hexadecimal, octal and decimal.

B2Binary translator — ToolsBoxx
Ready0 B sent to server

Your files never leave your device. Processing happens in your browser.How that works.

How it works

  1. Paste text, or paste binary, hex or octal digits.
  2. Pick the output base: binary, hexadecimal, octal or decimal.
  3. The conversion appears instantly; the direction is detected from your input.
  4. Copy the result or share the URL.

Runs as JavaScript inside this tab. Turn off your connection after the page loads and it still works.

ASCII and number-base reference

How text becomes binary

  1. Each character is mapped to a code point. For the basic Latin alphabet, digits and punctuation this is the ASCII table below (0–127).
  2. The code point is encoded as bytes using UTF-8. ASCII characters are one byte; é is two (C3 A9); most emoji are four.
  3. Each byte (0–255) is written in the target base and padded: 8 digits in binary, 2 in hexadecimal, 3 in octal.

Place values of an 8-bit byte

Bit 7 6 5 4 3 2 1 0
Value 128 64 32 16 8 4 2 1

01001000 = 64 + 8 = 72 = H.

Printable ASCII

Char Dec Hex Oct Binary
space 32 20 040 00100000
! 33 21 041 00100001
0 48 30 060 00110000
9 57 39 071 00111001
A 65 41 101 01000001
B 66 42 102 01000010
C 67 43 103 01000011
Z 90 5A 132 01011010
a 97 61 141 01100001
b 98 62 142 01100010
c 99 63 143 01100011
z 122 7A 172 01111010
~ 126 7E 176 01111110

Uppercase and lowercase letters differ by exactly one bit (bit 5, value 32): A is 01000001, a is 01100001.

Bases at a glance

Base Name Digits Digits per byte Prefix in code
2 Binary 0–1 8 0b
8 Octal 0–7 3 0o or leading 0
10 Decimal 0–9 1–3 none
16 Hexadecimal 0–9, A–F 2 0x

One hexadecimal digit represents exactly four bits (a nibble), which is why hex is the usual shorthand for binary data.

Worked examples

“Hi” to binary → 01001000 01101001

H is 72, i is 105. 72 = 64 + 8 → 01001000. 105 = 64 + 32 + 8 + 1 → 01101001.

“Hi” to hex → 48 69

Same bytes, two hex digits each: 72 = 4×16 + 8 → 48; 105 = 6×16 + 9 → 69.

Decoding 01010100 01101111 01101111 01101100 01110011 → Tools

Five groups of eight bits → 84, 111, 111, 108, 115 → T, o, o, l, s.

“é” to binary → 11000011 10101001

é is code point U+00E9. In UTF-8 that becomes two bytes, C3 A9, so it produces two 8-bit groups, not one.

Binary without spaces: 0100100001101001 → Hi

The decoder splits runs of binary into 8-bit chunks when the length is a multiple of 8.

Frequently asked questions

What is “hello” in binary?

In 8-bit ASCII, hello is 01101000 01100101 01101100 01101100 01101111.

Why does each letter use 8 bits?

ASCII only needs 7 bits, but computers store data in bytes of 8 bits, so the eighth bit is a leading zero. UTF-8 uses one to four bytes per character, so emoji and accented letters produce more than one 8-bit group.

How do I read binary code?

Split it into groups of 8 digits. Convert each group to decimal by adding the place values (128, 64, 32, 16, 8, 4, 2, 1) for every 1, then look the number up in an ASCII table. 01001000 is 72, which is “H”.

What is the difference between binary, octal and hexadecimal?

They are the same numbers written in base 2, base 8 and base 16. Hexadecimal is compact: one hex digit stands for exactly four binary digits, so a byte is two hex characters.

Does it handle emoji and non-English text?

Yes. Text is encoded as UTF-8, so “é” becomes two bytes and most emoji become four. Decoding reassembles the bytes into the original characters.

Binary translator · last updated · changelog · part of Canned Tuna