What is binary code?
Binary code writes information with just two symbols, 0 and 1. This guide shows how numbers and text become those two symbols, and how to read them back. Try it in the box first: type a word, or paste some binary.
On this page
The short answer
Binary code is a way of writing information using only two symbols, 0 and 1. Each 0 or 1 is called a bit. Computers use it because their circuits work with two states, such as a voltage being low or high, and two states are easy to tell apart reliably.
On its own a row of bits means nothing. It needs an agreed meaning: read as a whole number, as text in a character encoding such as ASCII or UTF-8, as a negative number, as a fraction, as a colour. The same eight bits, 01000001, are the number 65 and also the letter “A” in ASCII.
Counting in binary
Binary has two digits, so each place is worth twice the place to its right: 1, 2, 4, 8, 16 and so on. To read a binary number, add the place values where there is a 1: 1011 is 8 + 2 + 1 = 11. The binary number system guide covers counting, reading and a full binary chart.
Bits and bytes
Each 0 or 1 is a bit, and 8 bits make a byte. One byte has 256 different patterns, so it holds a number from 0 to 255, or one ASCII character. The bits and bytes guide explains the sizes, including why a kilobyte can mean 1,000 or 1,024 bytes.
How text becomes binary
Text is stored by giving every character a number, then writing the number in binary. ASCII, the original standard, numbers 128 characters from 0 to 127: “A” is 65, “a” is 97, a space is 32, and the codes 0 to 31 are control characters such as line feed. The ASCII table lists them all.
UTF-8 is the encoding most text uses today. It keeps the ASCII characters as the same single bytes and uses two, three or four bytes for every other character, from “é” to Chinese characters to emoji.
So “Hi” is two bytes: H is 72 and i is 105, which gives 01001000 01101001. Paste those bits into the binary translator and you get “Hi” back.
Common words in binary
| Word | Binary (ASCII and UTF-8) |
|---|---|
| Hello | 01001000 01100101 01101100 01101100 01101111 |
| Hi | 01001000 01101001 |
| Yes | 01011001 01100101 01110011 |
| No | 01001110 01101111 |
| OK | 01001111 01001011 |
| I love you | 01001001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101 |
Each letter is one byte, and the space in “I love you” is 00100000. Tap a word to open it in the text to binary converter.
Reading binary code by hand
- Split the bits into groups of eight.
- For each group, add the place values 128, 64, 32, 16, 8, 4, 2 and 1 wherever there is a 1.
- Look each number up in the ASCII table.
A shortcut for letters: capitals start with 010 and small letters with 011, and the last five bits give the position in the alphabet (00001 is A, 11010 is Z). The binary alphabet has the full list. To practise, print a binary worksheet with an answer key.
64 + 8 = 72 = H
Where you meet binary
| Where | Written as | The bits |
|---|---|---|
| A web colour | #FF8000 (orange) | 11111111 10000000 00000000: red 255, green 128, blue 0 |
| An IPv4 address | 192.168.1.1 | 11000000 10101000 00000001 00000001: one 32-bit number |
| A letter in a text file | A | 01000001: ASCII code 65 |
A web colour such as #FF8000 is three bytes in hex, one each for red, green and blue. An IPv4 address is four bytes, usually written as four decimal numbers separated by dots. The bit workbench shows any address as its 32 bits.
Negative numbers, fractions and more
Plain binary only covers whole numbers from 0 up. Computers store negative whole numbers in two’s complement, where the leftmost bit counts as negative, and numbers with a fractional part in IEEE 754 floating point, which splits the bits into a sign, an exponent and a significand.
Programmers often write binary in hexadecimal instead, because each hex digit stands for exactly four bits: 1111 1111 is FF.
Some devices use other bit codes as well, such as Gray code, where neighbouring numbers differ in only one bit.
On our other sites
- colorcodekit.com: Converts colour codes between HEX, RGB, HSL and more.
- cidrcalculator.net: Works out IP ranges and subnet masks from CIDR notation.
Sources and method
- RFC 20 (STD 80), ASCII format for network interchange, section 4: the 128 ASCII codes and control-character names. Checked 2026-11-25.
- RFC 3629 (STD 63), UTF-8, a transformation format of ISO 10646, section 4: which byte sequences are valid UTF-8. Checked 2026-11-25.
- W3C WebAssembly Core Specification, overview: integers are read as unsigned or as signed in two’s complement representation. Checked 2026-11-25.
- ECMA-262, ECMAScript Language Specification (Ecma International, living edition at tc39.es), section 6.1.6.1 The Number Type: JavaScript numbers are IEEE 754-2019 binary64 values, with every NaN encoding treated as one NaN. Checked 2026-11-25.
- RFC 791 (STD 5), Internet Protocol, section 2.3: an internet address is four octets (32 bits). Checked 2026-11-25.
- W3C CSS Color Module Level 3 (Recommendation, 18 January 2022), section 4.2.1: RGB colour values in #rrggbb hexadecimal notation. Checked 2026-11-25.
Questions
Is binary code a language?
Not in the sense of a spoken or programming language. It’s a way of writing data with two symbols; what the bits mean depends on the encoding or format agreed for them.
What does 01001000 01101001 mean?
Read as ASCII or UTF-8 text, it is “Hi”: 01001000 is 72 (H) and 01101001 is 105 (i).
Why do bytes have 8 bits?
Eight bits became the standard size on most computers. It’s enough for all 128 ASCII characters with a bit to spare, and two hex digits describe it exactly.
How do I translate binary code into words?
Paste it into the binary translator. It splits the bits into bytes, decodes them, and points out any byte that doesn’t decode.