Binary Converter Calculator

Binary (base 2)11111111
Octal (base 8)377
Hexadecimal (base 16)FF
Decimal (base 10)255
How this was calculated
  1. To convert 255 to binary, divide by 2 repeatedly and read the remainders upwards: 255 in base 2 is 11111111. Each binary digit (bit) is one power of two — the rightmost bit is worth 1, the next 2, then 4, 8 and so on.
  2. Grouping the binary digits in threes gives octal (377) and in fours gives hexadecimal (FF) — which is exactly why programmers use hex as shorthand for binary: one hex digit is precisely four bits.
  3. Check by place value: the binary digits of 11111111 sum back to 255 when each 1 is replaced by its power of two and the results are added.

Our binary converter calculator translates numbers between binary, decimal, octal, and hexadecimal. Type any value and it returns the equivalent in all the other bases. For example, it confirms that decimal 255 equals 11111111 in binary, 377 in octal, and FF in hexadecimal, the largest value of one byte. It also handles conversions in the other direction, such as binary 101101 equaling 45 in decimal, found by adding the place values 32 + 8 + 4 + 1. Binary place values double from the right: 1, 2, 4, 8, 16, 32, 64, 128.

This calculator relies on the standard place-value method used across mathematics and computer science. Binary digits are grouped in threes to produce octal and in fours to produce hexadecimal. Because one hex digit is exactly four bits, programmers use hex as binary shorthand. The method is trusted because converting bases never changes the quantity, only the symbols used to write it. This page shows the formula, step-by-step workings, worked examples, and sources so you can verify every result yourself.

Worked examples

Decimal 255 in binary, octal and hex

11111111 in binary, 377 in octal, FF in hex — the maxed-out byte every programmer recognises. (Decimal → binary, octal & hex · 255)

Binary (base 2)11111111
Octal (base 8)377
Hexadecimal (base 16)FF
Decimal (base 10)255

Binary 101101 back to decimal

Place values 32 + 8 + 4 + 1 give 45. (Binary → decimal · 101101)

Decimal (base 10)45
Binary echo101101
Hexadecimal2D

Octal 777 back to decimal

7×64 + 7×8 + 7 = 511. (Octal → decimal · 777)

Decimal (base 10)511
Octal echo777
Hexadecimal1FF

Why computers count in binary

Computers count in binary because their circuits only have two stable states: on and off. A switch is either conducting electricity or it is not, and there is no reliable third option inside a silicon chip. Engineers represent those two states with the digits 1 and 0, and every piece of data inside a computer — text, photos, video, program code — is ultimately stored as long strings of those two digits. A single 1 or 0 is called a bit, and eight bits together form one byte.

Binary place values double from the right, so a single byte has the columns 1, 2, 4, 8, 16, 32, 64, and 128. Add every column together and you get 255, which is why the number 255 keeps appearing in computing. Decimal 255 is 11111111 in binary, 377 in octal, and FF in hexadecimal — the largest value that fits in one byte. When a device, a color channel, or a file format is described as an 8-bit value, that upper limit of 255 is exactly what is being referenced.

Working with long strings of 1s and 0s is tedious for humans, so programmers shorten binary by grouping the digits. Grouping binary digits in threes gives octal, and grouping them in fours gives hexadecimal. One hex digit is exactly four bits, which is why programmers use hex as binary shorthand. A full byte of 11111111 becomes the two hex digits FF, which is far easier to read and type without losing any information.

It is important to understand that converting bases never changes the quantity, only the symbols used to write it. The value stored in the computer is the same whether it is written as 11111111, 255, 377, or FF. A binary converter calculator simply translates between these representations so the underlying number stays intact while the format matches the task at hand. The same principle applies to any value: binary 101101 is 45 in decimal because the active place values are 32, 8, 4, and 1, and octal 777 is 511 in decimal because each 7 carries a different weighted position (7 x 64, 7 x 8, and 7). The math does not change — only the notation does.

Worked examples: three conversions

A binary converter calculator is only as useful as your understanding of the math behind it. The three worked examples below show exactly how numbers move between bases, step by step. Converting bases never changes the quantity, only the symbols used to write it, so each result below represents the same value written three different ways.

Start with decimal 255, which is the largest value of one byte. In binary, 255 is 11111111. Binary place values double from the right: 1, 2, 4, 8, 16, 32, 64, 128. Adding every place value gives 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Grouping binary digits in threes gives octal, so 11111111 becomes 377 in octal. Grouping binary digits in fours gives hexadecimal, so 11111111 becomes FF in hexadecimal. One hex digit is exactly four bits, which is why programmers use hex as binary shorthand.

Now reverse direction. Binary 101101 is 45 in decimal. Reading the place values from the right, the active bits are 32, 8, 4, and 1, so the sum is 32 + 8 + 4 + 1 = 45. Octal 777 is 511 in decimal. The place values in octal are powers of 8, so the sum is 7 x 64 + 7 x 8 + 7 = 511. Each conversion keeps the same quantity while swapping the symbols used to write it.

Starting valueBaseResultPlace-value sum
255DecimalBinary 11111111128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255
255DecimalOctal 377Grouping binary 11111111 in threes gives 377
255DecimalHexadecimal FFGrouping binary 11111111 in fours gives FF
Binary 101101BinaryDecimal 4532 + 8 + 4 + 1 = 45
Octal 777OctalDecimal 5117 x 64 + 7 x 8 + 7 = 511
One hex digit is exactly four bits, which is why programmers use hex as binary shorthand.

How to use this binary converter

The binary converter calculator offers three modes so you can move between number bases without doing the math by hand. In binary-to-decimal mode, you type a string of binary digits and the tool returns the decimal equivalent. In octal-to-decimal mode, you enter an octal number and get its decimal value. The tool also produces hexadecimal output, which you can read by noting that hex uses the digits 0 through 9 plus the letters A through F to represent values 10 through 15.

Each mode has simple input rules. Binary input accepts only the digits 0 and 1 — any other character breaks the conversion because binary place values depend on powers of two. Octal input accepts only the digits 0 through 7, since the octal system is base eight. Hexadecimal output will contain the letters A through F alongside the digits 0 through 9, so a result like FF is a valid hex value, not an error. These rules exist because converting bases never changes the quantity, only the symbols used to write it.

The logic behind the conversions is straightforward. Binary place values double from the right: 1, 2, 4, 8, 16, 32, 64, 128. That is why binary 101101 equals 45 in decimal — you add the place values where a 1 appears (32 + 8 + 4 + 1). Octal works the same way but in base eight, so octal 777 equals 511 in decimal (7 x 64 + 7 x 8 + 7).

Hexadecimal connects to binary through grouping. Grouping binary digits in threes gives octal, and grouping them in fours gives hexadecimal. One hex digit is exactly four bits, which is why programmers use hex as binary shorthand. A useful reference point is decimal 255: it is 11111111 in binary, 377 in octal, and FF in hexadecimal. That value is the largest value of one byte, and seeing it across all four bases shows how the same quantity can be written with different symbols.

Converting by hand: remainders up, place values down

To convert a decimal number to binary by hand, divide by 2 and record the remainder. Divide the result by 2 again, record that remainder, and keep going until you reach 0. Then read the remainders from bottom to top — that is, from the last division up to the first. The result is your binary number. A binary converter calculator applies this same divide-by-2 method automatically, but working it out by hand helps you see where each bit comes from.

For example, take decimal 45. Divide 45 by 2 and the remainder is 1. Divide 22 by 2 and the remainder is 0. Continue this process — 11 gives remainder 1, 5 gives remainder 1, 2 gives remainder 0, and 1 gives remainder 1 — and you get the remainders 1, 0, 1, 1, 0, 1. Read those remainders upward and the answer is 101101. Converting bases never changes the quantity, only the symbols used to write it, so 45 and 101101 represent the exact same value.

Going the other direction, from binary back to decimal, you use place values. Binary place values double from the right: 1, 2, 4, 8, 16, 32, 64, 128. Each position holds either a 1 or a 0. Add up the place values where a 1 appears and skip the positions with a 0. For binary 101101, the 1s sit in the 32, 8, 4, and 1 columns, so the decimal value is 32 + 8 + 4 + 1 = 45.

The same place-value logic extends to larger numbers. Decimal 255 is 11111111 in binary — every place from 128 down to 1 is filled with a 1, which makes it the largest value of one byte. That same quantity is 377 in octal and FF in hexadecimal. Grouping binary digits in threes gives octal and in fours gives hexadecimal. One hex digit is exactly four bits, which is why programmers use hex as binary shorthand. Octal 777, for instance, equals 511 in decimal because 7 × 64 + 7 × 8 + 7 = 511.

Octal and hex: binary's shorthand

Binary place values double from the right: 1, 2, 4, 8, 16, 32, 64, 128. That pattern is simple, but binary numbers get long fast. Converting bases never changes the quantity, only the symbols used to write it. Grouping binary digits in threes gives octal and in fours gives hexadecimal — one hex digit is exactly four bits, which is why programmers use hex as binary shorthand. A binary converter calculator can show you all three representations at once.

Take binary 101101. Working from the right by place value, you get 32 + 8 + 4 + 1, which is 45 in decimal. Split those six bits into groups of three from the right — 101 and 101 — and each group maps to octal 5, giving you 55 in octal. Split the same bits into groups of four from the right — 10 and 1101 — and you get 2 and D, or 2D in hexadecimal. Same quantity, shorter symbols.

Both systems survive because they fit binary cleanly. Octal lives on in file permissions: octal 777 is 511 in decimal (7 x 64 + 7 x 8 + 7), and it grants read, write, and execute access to everyone. Three octal digits cover the three permission groups in one compact number. Hex shows up wherever bytes matter — colours, memory addresses, and machine code. Decimal 255 is 11111111 in binary, 377 in octal, and FF in hexadecimal — the largest value of one byte. Writing FF is cleaner than typing eight ones, and the mapping is exact: two hex digits always equal one byte.

Common traps

A binary converter calculator helps you avoid a few mistakes that trip up nearly everyone at some point. The most common trap is reading a binary string as if it were a decimal number. The string 101101 is not one hundred one thousand, one hundred and one. In binary, each position carries a different weight, and the place values double from the right: 1, 2, 4, 8, 16, 32, 64, 128. Working from the right, you add the values where a 1 appears: 32 + 8 + 4 + 1, which gives 45 in decimal. The digits look the same as decimal digits, but the value they represent depends entirely on the base.

Leading zeros are another source of confusion. In decimal, 007 and 7 are the same quantity, and the same rule holds in binary: 00101101 and 101101 both equal 45. Extra zeros on the left do not change the value. They do, however, matter when you are working with fixed-width data, because a byte always holds eight bits. Decimal 255 is the largest value of one byte, written 11111111 in binary, 377 in octal, and FF in hexadecimal. Those leading zeros are how you keep every value aligned to the correct width.

A third trap is using digits that do not exist in the base you have selected. Binary allows only 0 and 1, so any 2 through 9 in a binary input is illegal. Octal uses 0 through 7, so an 8 or 9 in an octal input is invalid. Hexadecimal solves this by adding letters: it uses 0 through 9 and then A through F for the values 10 through 15. This is one reason programmers reach for hex as a binary shorthand — one hex digit is exactly four bits, so you can represent any byte with two hex characters instead of eight binary digits.

It is worth remembering that converting between bases never changes the quantity, only the symbols used to write it. The number 45, the binary string 101101, and the hex value 2D all describe the exact same amount. Grouping binary digits in threes gives you octal, and grouping them in fours gives you hexadecimal, which is why those bases line up so neatly with binary and why a binary converter calculator can move between them so cleanly.

  • Binary 101101 equals 45 in decimal, not 101,101 — place values double from the right (1, 2, 4, 8, 16, 32, 64, 128).
  • Leading zeros do not change the value: 00101101 and 101101 both equal 45.
  • Each base only allows certain digits: binary uses 0–1, octal uses 0–7, and hexadecimal uses 0–9 plus A–F.
  • Converting bases changes the symbols, not the quantity — 45 in decimal, 101101 in binary, and 2D in hex are the same number.
If a conversion result seems far too large or too small, check whether you read a binary string as a decimal number. The string 101101 looks like 101,101 but its decimal value is just 45.

FAQs

What is 255 in binary?

255 in binary is 11111111 — eight ones, the largest value one byte can hold. Each of the eight positions represents a power of 2, and when all are set to 1, they add up to 255. This makes 255 a common upper limit in computing.

How do I convert binary to decimal?

Add the place values of the 1 digits: 101101 is 32 + 8 + 4 + 1 = 45. Each position in a binary number represents a power of 2, from right to left. Simply sum the values where a 1 appears, and skip the positions where a 0 appears.

What is octal 777 in decimal?

Octal 777 in decimal is 511. You calculate it as 7 x 64 + 7 x 8 + 7 = 511. Each position in an octal number represents a power of 8, from right to left. Multiply each digit by its place value, then add the results together to get the decimal equivalent.

Why does hexadecimal use letters?

Base 16 needs sixteen digits, so A-F stand for 10-15. One hex digit is exactly four binary digits, making hex a compact shorthand for binary. Using letters avoids creating new symbols and keeps each value a single character, which is useful for representing long binary numbers in programming.

How do I convert decimal to binary by hand?

Divide by 2 repeatedly and read the remainders from last to first — the reverse of the place-value addition used to convert back. Each division gives you one bit: a remainder of 1 means that place is set, and 0 means it is not. Continue until the quotient reaches 0.

Can a binary number contain the digit 2?

No. Binary uses only 0 and 1; octal uses 0-7. A digit outside the base's range means the number belongs to a different base. Each number system has its own valid digits, and 2 is valid in decimal or higher bases but never in binary.

Sources

Related calculators

Exponent Calculator
Any base to any power — whole, negative and fractional exponents — with squares and cubes for reference.
Scientific Notation Calculator
Convert any number into scientific notation and E-notation — or expand a coefficient × 10^n back into standard form — with the decimal-point moves shown.
Root Calculator
Square roots, cube roots and any nth root — with square and cube shown alongside and a check for perfect powers.
Probability Calculator
Two independent events, every combination: both happen, at least one, exactly one, or neither — from the two individual probabilities.