How to Use the Number Base Converter
Computers, programmers, and electronics engineers constantly switch between number bases: binary for hardware, octal for older systems and file permissions, decimal for everyday arithmetic, and hexadecimal as a compact shorthand for binary. This converter takes a number in any one of those four bases and instantly shows all four values at once, so you never have to convert twice or wonder whether a digit is legal in the base you chose.
- Type your numberEnter the value in the first box, for example 255, 1010, or FF. Whole non-negative numbers only; signs and decimal points are not part of these integer bases.
- Tell the converter which base it is inChoose binary, octal, decimal, or hexadecimal from the dropdown. This matters: 1010 means ten in binary but one thousand and ten in decimal.
- Press Convert and read all four resultsThe binary, octal, decimal, and hexadecimal values appear together, with the decimal value highlighted, so you can copy whichever form your code or homework needs.
- If an error appears, check your digitsEach base allows only certain digits. Binary allows only 0 and 1, so 102 is rejected; octal allows 0 to 7, so 89 is rejected; hexadecimal allows 0 to 9 and A to F, so G is rejected.
What Is a Number Base, and Why Do We Have More Than One?
A number base, also called a radix, is simply how many distinct digits a counting system uses before it carries over to a new place. Decimal, the system we learn as children, uses ten digits (0 to 9) because humans have ten fingers. Each position is worth ten times the one to its right: in 255, the digits mean 2 hundreds + 5 tens + 5 ones. Binary uses only two digits, 0 and 1, because computer hardware is built from switches that are either off or on. Each binary position is worth twice the one to its right, so 1010 means 8 + 0 + 2 + 0 = 10. Octal uses eight digits, 0 to 7, and hexadecimal uses sixteen: 0 to 9 plus the letters A to F for the values ten to fifteen.
Hexadecimal exists mainly as a convenience for humans reading binary. One hexadecimal digit corresponds to exactly four binary digits, so a long binary string like 11111111 collapses neatly into FF. That is why you see hexadecimal everywhere in computing: color codes on the web such as #FF5733 are really three hexadecimal bytes for red, green, and blue; memory addresses are shown in hex; and network engineers read device addresses in hex. Octal played a similar role in early computing, when machines used word sizes divisible by three bits, and it still appears in Unix file permissions, where a value like 755 encodes read, write, and execute rights for owner, group, and others.
| Base | Digits allowed | Example | Decimal value |
|---|---|---|---|
| Binary (2) | 0, 1 | 11111111 | 255 |
| Octal (8) | 0 to 7 | 377 | 255 |
| Decimal (10) | 0 to 9 | 255 | 255 |
| Hexadecimal (16) | 0 to 9, A to F | FF | 255 |
Converting by Hand: Two Worked Examples
Converting binary to decimal by hand teaches the place-value idea better than any definition. Take 101101. Reading from the right, the positions are worth 1, 2, 4, 8, 16, and 32. The digits are 1, 0, 1, 1, 0, 1 from the right, so the value is 1 + 4 + 8 + 32 = 45. Converting decimal to binary goes the other way: repeatedly divide by 2 and record the remainders. For 45, the remainders are 1, 0, 1, 1, 0, 1, and reading them backwards gives 101101, confirming the first conversion. Hexadecimal works the same way with powers of sixteen: 1A3 means 1 times 256, plus A (10) times 16, plus 3, which is 256 + 160 + 3 = 419.
A quick shortcut connects binary, octal, and hexadecimal without passing through decimal. Group binary digits in threes from the right for octal, or in fours for hexadecimal, then convert each group. For example, 101011110 becomes 101 011 110 in octal groups, which is 5 3 6, and 1 0101 1110 in hexadecimal groups, which is 1 5 E, so the value is 536 in octal and 15E in hexadecimal. Students often make two mistakes here: forgetting to pad the leftmost group with leading zeros, and reading groups from the left instead of the right. Both change the answer, so always start grouping at the rightmost digit.
Practical Tips and Common Mistakes
First, always state the base when sharing a number that could be ambiguous: writing 1010 alone does not tell anyone whether you mean ten or one thousand and ten, which is why programmers write prefixes such as 0b1010 for binary and 0xFF for hexadecimal. Second, remember that leading zeros do not change a value, so 0001010 in binary is still ten; they are often added purely to pad a number to a neat width, such as eight bits. Third, this converter handles whole numbers only. Fractions in other bases, negative numbers, and extremely long inputs beyond 64 digits are outside its scope, and the converter will tell you so rather than guessing. Finally, everything runs in your browser with no data sent anywhere, so you can convert homework answers, code constants, and permission values privately and as often as you like.