1101 1010₂ → hex and octal — number base conversion

coregrouping by 4 and by 3 bits

Answer

DA₁₆ = 332₈

Why this example is worth doing

The shortcut that makes hex worth knowing: because sixteen is two to the fourth, each hex digit is exactly four bits and conversion is pure grouping with no arithmetic at all. Octal groups by three for the same reason. The page shows the grouping from the right-hand end and warns about the one real pitfall — padding the leftmost group with leading zeros rather than trailing ones, which silently multiplies the value.

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 2 to base 16

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

Positional expansion of the input — Base 2 to base 16
digitvalueweightweight (base 10)digit x weight
112^7128128
112^66464
002^5320
112^41616
112^388
002^240
112^122
002^010
total218

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

Read the last column bottom to top. ↑ — Base 2 to base 16
ndivide byquotientremainder
218218 ÷ 1613A
1313 ÷ 160D
Shortcut: group the binary digits in 4s outward from the radix point — Base 2 to base 16
sidegroups of 4base 16
integer side (pad left)1101 1010DA

11011010 (base 2)DA (base 16)

Base 2 to base 8

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

Positional expansion of the input — Base 2 to base 8
digitvalueweightweight (base 10)digit x weight
112^7128128
112^66464
002^5320
112^41616
112^388
002^240
112^122
002^010
total218

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

Read the last column bottom to top. ↑ — Base 2 to base 8
ndivide byquotientremainder
218218 ÷ 8272
2727 ÷ 833
33 ÷ 803
Shortcut: group the binary digits in 3s outward from the radix point — Base 2 to base 8
sidegroups of 3base 8
integer side (pad left)011 011 010332

11011010 (base 2)332 (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