Skip to main content
CalcChef

Number Base Converter

Convert a whole number between binary, octal, decimal and hexadecimal and see all four at once: 255 is 11111111, 377 and FF. How it works

Use the Number Base Converter

Whole numbers only: fractions are not supported. Negative numbers are shown with a minus sign (for example -101), not in two's complement. Digits that do not belong to the chosen base are reported by name.

Binary result
11111111
To
11111111

The same value in all four bases

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

Reference: 0 to 16

The numbers 0 to 16 in decimal, binary, octal and hexadecimal
DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

About the Number Base Converter

255 in decimal is 11111111 in binary, 377 in octal and FF in hexadecimal. The number base converter shows a whole number in all four bases at once; each digit counts a power of its base, so 377 in octal is 3 × 64 + 7 × 8 + 7 = 255.

The same numbers in four bases

DecimalBinaryOctalHexadecimal
10101012A
100110010014464
25511111111377FF
4931111011017551ED
1000111110100017503E8
-10-1010-12-A

Negative numbers keep a minus sign in every base.

Powers of two in four bases

PowerDecimalOctalHexadecimalBinary digits
2⁴1620105
2⁸2564001009
2¹⁰1024200040011
2¹⁶655362000001000017
2³²42949672964000000000010000000033
2⁵³90071992547409924000000000000000002000000000000054
2⁶⁴1844674407370955161620000000000000000000001000000000000000065

In binary a power of two is 1 followed by zeros. 2⁵³ is where ordinary JavaScript numbers stop holding every whole number; this converter uses BigInt and stays exact up to 4,096 decimal digits.

Frequently asked questions

How do I convert decimal to binary?
Divide by 2 again and again and read the remainders from last to first: 10 ÷ 2 = 5 r 0, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0, 1 ÷ 2 = 0 r 1, so 10 is 1010.
How do I convert binary to hexadecimal?
Split the binary digits into groups of four from the right and replace each group with one hex digit: 1111 0000 is F0, which is 240. The converter accepts the space between groups and can print binary output in 4-bit groups.
What is octal used for?
Mostly Unix file permissions, where each octal digit holds three bits: 755 in octal is 111101101 in binary and 493 in decimal.
How are negative numbers shown?
With a minus sign: -10 is -1010 in binary, -12 in octal and -A in hexadecimal. Two’s complement is not offered.
Can it convert fractions such as 0.5?
No. A decimal point or comma gets a message that fractions are not supported; only whole numbers are converted.
Can I type 0x, 0b or lowercase hex?
Yes, when the prefix matches the From base: 0xff with From set to hexadecimal gives 255, and 0b1010 with binary gives 10. With From set to decimal, 0x1F is rejected because x is not a decimal digit. Hex letters can be upper or lower case; the output uses capitals. One space or underscore between digit groups is accepted, so 1111_0000 in binary gives F0, but two spaces in a row give an error. Values are converted exactly up to 4,096 decimal digits. To get the prefix in the output, tick Show the 0b, 0o or 0x prefix: 255 then shows as 0b11111111, 0o377 and 0xFF.

Related Tools

View all tools