Hexadecimal to Octal
Hexadecimal (hex)
Octal (oct)
How it is calculated
The number is first converted to decimal as digits × radixⁿ, then to the selected base by division with remainder. Prefixes 0x, 0b, 0o and digit grouping with spaces or _ are allowed.
hex: digits 0 1 2 3 4 5 6 7 8 9 A B C D E F, radix 16
oct: digits 0 1 2 3 4 5 6 7, radix 8
255₁₆ = 2×16₂ + 5×16₁ + 5×16₀ = 512 + 80 + 5 = 597₁₀
597 ÷ 8 = 74 remainder 5 (5)
74 ÷ 8 = 9 remainder 2 (2)
9 ÷ 8 = 1 remainder 1 (1)
1 ÷ 8 = 0 remainder 1 (1)
255₁₆ = 1125₈