コンテンツへ移動

Number Base Converter

Computers work internally in binary, and programmers often use hexadecimal notation for memory addresses and colour codes. Enter an ordinary decimal number to see it instantly converted to binary, octal and hexadecimal — handy for programming, networking or number-system homework.

結果

11111111

Binary (base 2)

Octal (base 8)
377
Hexadecimal (base 16)
FF
Decimal (for reference)
255

公式

Each base expresses the same number using a different number of symbols: value = Σ (digit × base^position)

Decimal (base 10) uses digits 0-9. Binary (base 2) uses only 0 and 1: each position represents a power of 2. Octal (base 8) uses 0-7, with powers of 8. Hexadecimal (base 16) uses 0-9 and A-F (where A=10 through F=15), with powers of 16. The number itself never changes — only the way it is written down.

ステップ解説

  1. 1Enter a decimal (base 10) whole number, from 0 to 4,294,967,295.
  2. 2The calculator instantly converts it to binary, octal and hexadecimal.
  3. 3Read off the three results, plus the decimal number for reference.

計算例

The number 255

Binary 11111111, octal 377, hexadecimal FF.

The number 42

Binary 101010, octal 52, hexadecimal 2A.

The number 4096

Binary 1000000000000, octal 10000, hexadecimal 1000.

Reference table

Decimal, binary, octal and hexadecimal compared
DecimalBinaryOctalHexadecimal
81000108
16100002010
321000004020
64100000010040
1281000000020080
25511111111377FF

Each step in the decimal column doubles the value and adds a digit in the other bases.

よくある間違い

  • Reading hexadecimal letters (A-F) as separate characters rather than as the values 10 through 15.
  • Assuming the leftmost digit is always the "units"; in every base it is actually the rightmost digit that is the unit (position 0).
  • Forgetting that a negative number or a decimal fraction cannot go directly into this field; it only works for whole numbers from 0 upward.

活用シーン

  • Understanding and building colour codes such as #FF5733 in web design.
  • Debugging memory sizes, IP addresses and error codes shown in hex or binary.
  • Checking homework or exams about number systems without converting by hand.

よくある質問

Why do programmers use hexadecimal?

Each hexadecimal digit corresponds to exactly 4 binary digits, which makes long binary numbers far more compact and readable. For example, 0xFF (2 characters) represents 11111111 (8 characters).

How do I convert a decimal number to binary by hand?

Repeatedly divide the number by 2 and note the remainder (0 or 1) each time. Read the remainders bottom to top to get the binary number. For 42: 42÷2=21 r0, 21÷2=10 r1, 10÷2=5 r0, 5÷2=2 r1, 2÷2=1 r0, 1÷2=0 r1 → 101010.

What is the largest number this calculator can handle?

4,294,967,295 (2³² − 1) — the largest number that fits in 32 bits, the range of an unsigned 32-bit integer.

Why do hexadecimal numbers sometimes start with "0x"?

The "0x" prefix is a programming convention that marks a number as hexadecimal, so 0x10 (16) is not mistaken for the decimal number 10.

Was this calculator helpful?