1024₁₀ → binary, hex and octal — number base conversion

edge caseone value in four bases at once

Answer

10000000000₂ = 400₁₆ = 2000₈

Why this example is worth doing

A power of two shown in every base the tool supports, which makes the structural point that all four representations are the same number and only the notation differs. Powers of two are exactly the values that are a single 1 followed by zeros in binary, and the position of that 1 is the exponent. The page uses this to introduce the kilobyte ambiguity — 1024 against 1000 — which is a real source of confusion in storage specifications.

Try your own input in the Binary ⇄ decimal ⇄ hex ⇄ octal. Convert between any two bases, integers and fractions, with the positional working.

How the answer is reached

Base 10 to base 2

Convert 1024 from base 10 to base 2. The sign is carried across unchanged; only the magnitude is converted.

Positional expansion of the input — Base 10 to base 2
digitvalueweightweight (base 10)digit x weight
1110^310001000
0010^21000
2210^11020
4410^014
total1024

Integer part: divide by 2 and read the remainders bottom to top.

Read the last column bottom to top. ↑ — Base 10 to base 2
ndivide byquotientremainder
10241024 ÷ 25120
512512 ÷ 22560
256256 ÷ 21280
128128 ÷ 2640
6464 ÷ 2320
3232 ÷ 2160
1616 ÷ 280
88 ÷ 240
44 ÷ 220
22 ÷ 210
11 ÷ 201

1024 (base 10)10000000000 (base 2)

Base 10 to base 16

Convert 1024 from base 10 to base 16. The sign is carried across unchanged; only the magnitude is converted.

Positional expansion of the input — Base 10 to base 16
digitvalueweightweight (base 10)digit x weight
1110^310001000
0010^21000
2210^11020
4410^014
total1024

Integer part: divide by 16 and read the remainders bottom to top.

Read the last column bottom to top. ↑ — Base 10 to base 16
ndivide byquotientremainder
10241024 ÷ 16640
6464 ÷ 1640
44 ÷ 1604

1024 (base 10)400 (base 16)

Base 10 to base 8

Convert 1024 from base 10 to base 8. The sign is carried across unchanged; only the magnitude is converted.

Positional expansion of the input — Base 10 to base 8
digitvalueweightweight (base 10)digit x weight
1110^310001000
0010^21000
2210^11020
4410^014
total1024

Integer part: divide by 8 and read the remainders bottom to top.

Read the last column bottom to top. ↑ — Base 10 to base 8
ndivide byquotientremainder
10241024 ÷ 81280
128128 ÷ 8160
1616 ÷ 820
22 ÷ 802

1024 (base 10)2000 (base 8)

Compare with

Open this example in the Binary ⇄ decimal ⇄ hex ⇄ octal

The field arrives filled in with this example’s input.

Note:

Notation this page assumes

  • Bit strings are written most significant bit first, and bit 0 is the least significant bit.
  • A width is stated explicitly wherever it changes the answer; nothing is silently sign-extended or truncated.
  • Fractions are converted digit by digit and shown to a stated number of places rather than rounded silently.

Sources

  • Knuth, The Art of Computer Programming, Vol. 2, §4.1 “Positional Number Systems” (1997)
  • IEEE 754-2019, Standard for Floating-Point Arithmetic