Dev ToolsMarch 28, 2026

Text to Binary Conversion Guide: How Computers Encode Text (2026)

By The hakaru Team·Last updated March 2026

Quick Answer

  • *Text-to-binary conversion works by mapping each character to its ASCII or Unicode decimal value, then converting that number to 8-bit binary.
  • *"Hello" in binary is 01001000 01100101 01101100 01101100 01101111 — 5 bytes, 40 bits total.
  • *ASCII covers 128 characters (7 bits). Unicode/UTF-8 extends this to over 149,000 characters and powers 98.1% of all websites.
  • *Computers use binary because transistors have two physical states: on (1) and off (0). Every operation a CPU performs comes down to billions of these switches per second.

What Is Binary? The Base-2 Number System

Binary is a base-2 number system. Where the decimal system you use every day has ten digits (0–9), binary has just two: 0 and 1. Every number, letter, image, and video file on your computer is ultimately stored and processed as a sequence of these two values.

In binary, each digit position represents a power of 2. From right to left: 20 = 1, 21 = 2, 22 = 4, 23 = 8, 24 = 16, 25 = 32, 26 = 64, 27 = 128. An 8-bit group (one byte) can represent any number from 0 to 255.

To read a binary number like 01000001, multiply each bit by its positional value and sum: 0 + 64 + 0 + 0 + 0 + 0 + 0 + 1 = 65. In ASCII, 65 = the letter “A”.

A modern CPU runs at 3–5 GHz — meaning it executes 3 to 5 billion binary switching operations per second (source: Intel and AMD processor specifications). Every one of those operations is a transistor turning on or off.

ASCII: The Foundation of Text Encoding

ASCII (American Standard Code for Information Interchange) was developed in 1963 by the American Standards Association — now ANSI. It was the first widely adopted standard for encoding text as numbers so computers could communicate.

ASCII defines 128 charactersusing 7 bits: uppercase and lowercase English letters, the digits 0–9, punctuation marks, and 33 non-printable control characters (like newline and tab). A single ASCII character takes up 1 byte (8 bits, with the leading bit set to 0).

That means “Hello” in ASCII requires 5 bytes = 40 bits. Short by modern standards, but revolutionary in 1963 when memory was measured in kilobytes.

ASCII Reference Table

CharacterDecimalBinary
Space3200100000
!3300100001
"3400100010
#3500100011
04800110000
14900110001
95700111001
A6501000001
B6601000010
C6701000011
H7201001000
Z9001011010
a9701100001
b9801100010
e10101100101
l10801101100
o11101101111
z12201111010
{12301111011
~12601111110

Notice the pattern: uppercase letters start at 65, lowercase at 97. The difference between “A” (65) and “a” (97) is exactly 32 — which in binary is just flipping bit 5. That’s why case conversion is cheap in computing.

Converting “Hello” to Binary: Step by Step

Let’s walk through the full conversion of “Hello” character by character.

CharacterASCII DecimalBinary
H7201001000
e10101100101
l10801101100
l10801101100
o11101101111

Full binary string: 01001000 01100101 01101100 01101100 01101111

That’s 40 bits total. Let’s verify “H” manually. H = 72 in decimal. Convert 72 to binary:

  • 72 ÷ 2 = 36 remainder 0
  • 36 ÷ 2 = 18 remainder 0
  • 18 ÷ 2 = 9 remainder 0
  • 9 ÷ 2 = 4 remainder 1
  • 4 ÷ 2 = 2 remainder 0
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1

Reading the remainders bottom to top: 1001000. Pad to 8 bits: 01001000. That’s the binary for “H”.

Alternatively, use the positional method: 01001000 = 0 + 64 + 0 + 8 + 0 + 0 + 0 + 0 = 72. Both methods confirm the same result.

Unicode and UTF-8: Beyond ASCII

ASCII covers only 128 characters, which is fine for English but leaves out virtually every other language. In the 1990s, the Unicode Consortium set out to fix this with a single standard covering all the world’s writing systems.

As of Unicode 15.1 (2023), the standard supports over 149,000 characters across 161 scripts— including Chinese, Arabic, Hebrew, Devanagari, emoji, and ancient scripts like Cuneiform (source: Unicode Consortium). Each character is assigned a “code point,” written as U+ followed by a hex number (e.g., U+0041 for “A”, U+1F600 for 😀).

UTF-8 is the most widely used encoding of Unicode. It was designed in 1992 by Ken Thompson and Rob Pike — two of the creators of Unix and the Go programming language. UTF-8 is a variable-width encoding:

  • Characters U+0000 to U+007F (basic ASCII) use 1 byte — identical to ASCII
  • Characters U+0080 to U+07FF use 2 bytes
  • Characters U+0800 to U+FFFF use 3 bytes
  • Characters U+10000 to U+10FFFF use 4 bytes

This backward compatibility means any ASCII text is also valid UTF-8. That design choice is a big reason UTF-8 now powers 98.1% of all websites (W3Techs, 2026).

For example, the emoji 😀 (U+1F600) in UTF-8 is stored as 4 bytes: F0 9F 98 80 in hex, or 11110000 10011111 10011000 10000000 in binary.

Why Computers Use Binary

The short answer: physics. Modern computers are built from billions of transistors — tiny semiconductor switches that are either conducting current (on = 1) or blocking it (off = 0). Binary maps directly to these two stable physical states.

Using more than two states would require analog circuits that are slower, less reliable, and far harder to manufacture at scale. Binary is simple, fast, and tolerant of electrical noise (a signal at 0.3V and one at 0.1V are both “0” — it doesn’t matter).

Higher-level abstractions stack on top of binary: hexadecimal (base-16) is used by programmers for compactness, decimal is used for human-facing output, and UTF-8 turns binary into readable text. But underneath it all, every instruction and every byte of data is stored and moved as a sequence of 0s and 1s.

Practical Applications of Binary Encoding

Network Protocols

Every packet of data sent over the internet is transmitted as binary. HTTP headers, JSON payloads, images — all binary at the transport layer. TCP/IP itself is defined in terms of bit fields.

File Formats

Text files (like .txt or .csv) store characters as binary per the encoding (usually UTF-8). Binary file formats like JPEG, MP3, and PDF store structured binary data that is not directly human-readable — though tools like hex editors let you inspect the raw bytes.

Cryptography

Encryption algorithms like AES and RSA operate on binary data. When you send a message over HTTPS, your data is transformed into ciphertext using bitwise XOR, shifts, and substitution operations — all binary math.

Debugging and Low-Level Programming

Understanding binary is essential for working with bitwise operators in code (&, |, ^, <<, >>), reading memory dumps, interpreting Unix file permissions (chmod 755 = 111 101 101 in binary), and decoding network packets.

Convert any text to binary instantly

Use our free Text to Binary Converter →

Frequently Asked Questions

How do you convert text to binary?

Find the ASCII or Unicode decimal value for each character, then convert that decimal number to an 8-bit binary string. “A” = 65 decimal = 01000001 binary. For any input longer than a few characters, use our Text to Binary Converter— it handles the full conversion instantly.

What is ASCII?

ASCII (American Standard Code for Information Interchange) was developed in 1963 by the American Standards Association. It maps 128 characters to numbers 0–127 using 7 bits. Every basic English letter, digit, and punctuation mark has an ASCII code. A single ASCII character = 1 byte = 8 bits.

How do you read binary code?

Each bit position represents a power of 2 (from right to left: 1, 2, 4, 8, 16, 32, 64, 128). Add up the values for every position where the bit is 1. For 01000001: 0 + 64 + 0 + 0 + 0 + 0 + 0 + 1 = 65 = “A”. Then look up the decimal in an ASCII or Unicode table to get the character.

What is the binary code for “Hello”?

“Hello” in binary is 01001000 01100101 01101100 01101100 01101111. That breaks down as: H (72) = 01001000, e (101) = 01100101, l (108) = 01101100, l (108) = 01101100, o (111) = 01101111. Five characters, five bytes, 40 bits.

What is the difference between ASCII and Unicode?

ASCII covers 128 characters (basic English only). Unicode covers over 149,000 characters across 161 scripts — every major language, emoji, and many historical writing systems. UTF-8 is the dominant Unicode encoding, used by 98.1% of all websites (W3Techs, 2026). ASCII characters are a perfect subset of UTF-8, so the two systems are compatible for English text.

Why do computers use binary?

Transistors — the fundamental components of all modern processors — are binary switches: on (1) or off (0). Using two states keeps hardware simple, fast, and electrically tolerant. A modern CPU runs at 3–5 GHz, executing billions of binary operations per second. Higher number bases would require analog precision that degrades under heat, noise, and manufacturing variation.