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

The formula

binary place values=,8,4,2,1\text{binary place values} = \ldots, 8, 4, 2, 1
binary — base 2 — digits 0 and 1
octal — base 8 — digits 0 to 7
hex — base 16 — digits 0–9 and A–F

How it works

Convert a decimal (base-10) number into binary, octal and hexadecimal — the number bases computers use. Enter a whole number and see how the same value looks in each system.

FAQ

Why do computers use binary?

Because electronic circuits have two easy states — on and off — which map perfectly to the 1s and 0s of binary. Every number, letter and image inside a computer is ultimately stored as a pattern of these two digits.

What is hexadecimal for?

Hex (base 16) is a compact, human-friendly way to write binary: each hex digit stands for exactly four binary digits. That is why colours in web design and memory addresses are written in hex, like #FF8800.

How are negative numbers stored in binary?

Computers typically use two’s complement: flip every bit of the positive value and add one. This calculator shows a simple sign-and-magnitude form instead — a minus sign in front of the binary digits — which is easier to read but not how hardware stores negatives internally.

What is the difference between a bit and a byte?

A bit is a single binary digit, 0 or 1. A byte is a group of eight bits and can represent 256 different values, from 0 to 255 — which is why 255 is the largest number a single byte can hold.

What is the largest number a given number of bits can hold?

An unsigned binary number with n bits can represent values from 0 up to \(2^n - 1\). For example, 8 bits reach 255, 16 bits reach 65,535, and 32 bits reach 4,294,967,295.

Can this calculator convert decimals or fractions?

No — it converts whole numbers only. Fractional values need a separate binary-point representation, where digits after the point represent halves, quarters, eighths and so on.

What is octal used for today?

Octal is less common now than hex but still appears in Unix file permission codes, like chmod 755, because three binary digits map neatly to one octal digit, making permission bits easy to read at a glance.

About the binary calculator

This calculator converts a decimal number into binary, octal and hexadecimal — the number systems that sit underneath all computing. We count in base 10 using ten digits, but computers work in base 2 (binary) using just 0 and 1, and programmers often use base 8 and base 16 as shorthand. Seeing a number in all four bases at once makes the relationship between them clear.

How to use it

Enter a whole decimal number and the calculator shows it in binary, octal and hexadecimal. For example, 255 is 11111111 in binary, 377 in octal and FF in hexadecimal — which is why 255 is the maximum value of a single byte and the top of each colour channel. Try powers of two, like 8, 16 or 256, to see the neat patterns they make in binary.

The formula

Each base uses place values that are powers of its base. In binary the places are ,8,4,2,1\ldots, 8, 4, 2, 1 (powers of two); the number 13 is 8+4+18 + 4 + 1, so it is written 1101. Converting works by repeatedly dividing by the base and reading the remainders from bottom to top. Hexadecimal groups binary in fours, so each hex digit maps to four bits, and octal groups it in threes.

Where it is used

Binary and hexadecimal are everywhere in computing. Programmers use them to work with memory, bit flags and low-level data; web designers write colours as hex codes; and network engineers read IP addresses and subnet masks in binary. Understanding how decimal maps to these bases is a foundation of computer science, and this converter is a quick way to move between them.