Binary Translator — Text to Binary & Binary to Text

Conversion runs entirely in your browser. No data is uploaded, logged, or stored.

What is Binary?

Binary is a base-2 number system that uses only two digits: 0 and 1. Every piece of data a computer processes — text, images, audio, programs — is ultimately stored as a sequence of these two values. A PNG is just such a byte sequence; the image to Base64 converter regroups its bits six at a time so the picture can be embedded in HTML or CSS as plain text. A single binary digit is called a bit; eight bits form a byte, which can represent 256 different values (28 = 256). The letter "A" in ASCII is the byte 01000001, which is the number 65 in decimal.

Binary exists because digital circuits are built from transistors that have two states: on and off. The entire stack — from logic gates to processors to programming languages — rests on this foundation. Understanding binary is not just academic; it appears in debugging, networking, file formats, and permissions.

How Text-to-Binary Translation Works

Converting text to binary is a two-step process. First, each character is mapped to a number using a character encoding — ASCII for English letters and symbols, UTF-8 for everything else including emoji and accented characters. Second, each number is converted to its binary representation, padded to 8 bits per byte.

For ASCII characters (codes 0-127), each character is exactly one byte. The letter "H" is 72 in decimal, which is 01001000 in binary. The word "Hi" becomes 01001000 01101001 — two bytes, 16 bits.

For characters outside ASCII — accented letters, CJK characters, emoji — UTF-8 uses multiple bytes per character. The emoji 🚀 is four bytes in UTF-8: 11110000 10011111 10011010 10000000. This tool handles UTF-8 automatically, so emoji and international text convert correctly. This is the same UTF-8 encoding step that matters in Base64 encoding and hashing — get the encoding wrong and the output is wrong.

ASCII to Binary Table — All Printable Characters

Every printable ASCII character from 32 (space) to 126 (tilde), plus 127 (DEL), with the 8-bit pattern this translator produces for it. Codes 0–31 are control characters such as tab (00001001) and newline (00001010).

DecBinaryCharDecBinaryCharDecBinaryChar
3200100000(space)6401000000@9601100000`
3300100001!6501000001A9701100001a
3400100010"6601000010B9801100010b
3500100011#6701000011C9901100011c
3600100100$6801000100D10001100100d
3700100101%6901000101E10101100101e
3800100110&7001000110F10201100110f
3900100111'7101000111G10301100111g
4000101000(7201001000H10401101000h
4100101001)7301001001I10501101001i
4200101010*7401001010J10601101010j
4300101011+7501001011K10701101011k
4400101100,7601001100L10801101100l
4500101101-7701001101M10901101101m
4600101110.7801001110N11001101110n
4700101111/7901001111O11101101111o
480011000008001010000P11201110000p
490011000118101010001Q11301110001q
500011001028201010010R11401110010r
510011001138301010011S11501110011s
520011010048401010100T11601110100t
530011010158501010101U11701110101u
540011011068601010110V11801110110v
550011011178701010111W11901110111w
560011100088801011000X12001111000x
570011100198901011001Y12101111001y
5800111010:9001011010Z12201111010z
5900111011;9101011011[12301111011{
6000111100<9201011100\12401111100|
6100111101=9301011101]12501111101}
6200111110>9401011110^12601111110~
6300111111?9501011111_12701111111(DEL)

Binary Alphabet — Letters A to Z in Binary

The binary alphabet is simply the ASCII codes for the 26 letters written in base 2. Uppercase A is 65 (01000001) and each following letter adds one, up to Z at 90 (01011010). Lowercase a starts at 97 (01100001) and runs to z at 122 (01111010).

UpperBinaryLowerBinary
A01000001a01100001
B01000010b01100010
C01000011c01100011
D01000100d01100100
E01000101e01100101
F01000110f01100110
G01000111g01100111
H01001000h01101000
I01001001i01101001
J01001010j01101010
K01001011k01101011
L01001100l01101100
M01001101m01101101
N01001110n01101110
O01001111o01101111
P01010000p01110000
Q01010001q01110001
R01010010r01110010
S01010011s01110011
T01010100t01110100
U01010101u01110101
V01010110v01110110
W01010111w01110111
X01011000x01111000
Y01011001y01111001
Z01011010z01111010

Compare any row and you will see a pattern: an uppercase letter and its lowercase partner differ in exactly one bit, the third from the left, which is worth 32. Uppercase letters begin 010, lowercase letters begin 011, and the last five bits give the letter's position in the alphabet (00001 for A, 11010 for Z, which is 26). That is why case conversion in C is often written as c ^ 0x20: flipping bit 5 toggles the case of any ASCII letter.

To write a word in binary, look up each letter and join the bytes. Ada becomes 01000001 01100100 01100001, and SOS becomes 01010011 01001111 01010011. Case matters: Hello starts with 01001000 while hello starts with 01101000.

How to Read Binary by Hand

Each position in a byte has a place value, doubling from right to left. To turn a byte into a number, add up the place values wherever there is a 1:

Place value1286432168421Sum
010010000100100064 + 8 = 72 → H
011010010110100164 + 32 + 8 + 1 = 105 → i

So 01001000 01101001 is 72 and 105, which the ASCII table above turns into Hi. Going the other way, divide by 2 repeatedly and write down the remainders. For 105: 105 → 52 remainder 1, 52 → 26 r 0, 26 → 13 r 0, 13 → 6 r 1, 6 → 3 r 0, 3 → 1 r 1, 1 → 0 r 1. Reading the remainders from the last one back to the first gives 1101001. Pad that to eight bits with a leading zero and you get 01101001, which is exactly what the translator prints for i.

Binary in Programming

Binary is not just a theoretical concept — it shows up directly in everyday programming:

How to Convert in Code

JavaScript

// Text to binary
const binary = [...new TextEncoder().encode("Hello")]
  .map(b => b.toString(2).padStart(8, "0")).join(" ");

// Binary to text
const text = new TextDecoder().decode(
  new Uint8Array("01001000 01101001".split(" ")
    .map(b => parseInt(b, 2)))
);

Python

# Text to binary
binary = ' '.join(format(b, '08b') for b in "Hello".encode('utf-8'))

# Binary to text
text = bytes(int(b, 2) for b in "01001000 01101001".split()).decode('utf-8')

Bash

# Text to binary (one byte per line)
echo -n "Hello" | xxd -b | cut -d' ' -f2-7

# Binary to text
echo "01001000 01101001" | perl -lape '$_=pack"B*",join"",@F'

Encoding Matters: ASCII vs UTF-8

ASCII maps 128 characters to the numbers 0-127, each fitting in a single byte. It covers English letters, digits, punctuation, and control characters. For decades this was sufficient, but it cannot represent accented characters, Chinese, Arabic, or emoji.

UTF-8 is a variable-length encoding that is backward-compatible with ASCII: characters 0-127 are identical. Characters above 127 use 2-4 bytes, with leading bits that indicate the byte count. This is why "é" is two bytes in UTF-8 (11000011 10101001) but one byte in Latin-1 (11101001). This tool uses UTF-8, which is the encoding of the modern web — over 98% of websites use it.

Common Binary Prefixes

PrefixSymbolBytesDecimal approx.
KilobyteKB1,024~1 thousand
MegabyteMB1,048,576~1 million
GigabyteGB1,073,741,824~1 billion
TerabyteTB1,099,511,627,776~1 trillion

The discrepancy between binary (1 KB = 1,024 bytes) and decimal (1 kB = 1,000 bytes) definitions is why a "500 GB" hard drive shows as 465 GB in your operating system. Storage manufacturers use decimal; operating systems use binary. The IEC introduced unambiguous prefixes — kibibyte (KiB), mebibyte (MiB) — but adoption remains inconsistent.

Binary and Other Number Bases

Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) are different ways to represent the same numbers. Programmers use hex because each hex digit maps to exactly four bits, making it a compact way to write binary. (To convert a number rather than text between these bases — including 64-bit values and negative numbers in two's complement — use the hex converter.)

BinaryDecimalOctalHex
0000000
0001111
0101555
10101012A
11111517F
11111111255377FF

This is why hash outputs are displayed in hex rather than binary — a SHA-256 digest is 256 bits, which is 64 hex characters instead of 256 binary digits.

Two's Complement — How Computers Store Negative Numbers

Computers represent negative integers using two's complement. To negate a number: flip every bit and add 1. In an 8-bit system, 00000101 is +5 and 11111011 is −5. The leading bit acts as a sign indicator: 0 for positive, 1 for negative. This system has a useful property — addition works the same for positive and negative numbers, so the processor does not need separate circuits for subtraction.

Common Mistakes When Translating Binary

Frequently Asked Questions

Is my data sent to a server?
No. All conversion runs in your browser using JavaScript. Nothing is transmitted, logged, or stored.
Why does my emoji produce more than 8 bits?
Because emoji are multi-byte characters in UTF-8. A single emoji like 🚀 is 4 bytes (32 bits). This tool uses UTF-8 encoding, which is the standard on the modern web and handles all Unicode characters correctly.
What separators can I use between bytes?
The tool supports spaces (the default and most readable), no separator (a continuous stream of 0s and 1s), and newlines (one byte per line). When decoding binary back to text, all non-binary characters (anything that is not 0 or 1) are stripped automatically, so any separator works on input.
What if my binary string is not a multiple of 8 bits?
The tool reports an error. Each byte is 8 bits, so valid binary text must have a total number of 0s and 1s divisible by 8. The error message tells you how many bits are missing.
What is "hello" in binary?
In UTF-8 (and ASCII), hello is 01101000 01100101 01101100 01101100 01101111, which is 5 bytes or 40 bits. With a capital H, Hello starts with 01001000 instead; only the first byte changes.
Why does typing a number not give its binary value?
A binary translator converts text characters, so 65 is treated as the two characters "6" and "5" and becomes 00110110 00110101. The number 65 in binary is 01000001, which is also the ASCII code for the letter A.
Is binary the same as machine code?
Not exactly. Machine code is binary instructions that a specific processor understands, but not all binary is machine code. Text, images, and data files are also stored in binary. Machine code is the subset of binary that encodes executable instructions for a particular CPU architecture.
How is binary related to Base64?
Base64 is an encoding that converts binary data (arbitrary bytes) into text using 64 printable characters. It exists because some transport layers — email, URLs, JSON — cannot carry raw binary safely. Our Base64 encoder performs that conversion.