Convert Hexadecimal to Octal

Convert Hexadecimal (hex) to Octal (oct) instantly and accurately.

Selected Hexadecimal (hex) - available characters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Hexadecimal (hex)
Octal (oct)

Conversion Formula

Step-by-step example using the value 42 (decimal):

Convert Hexadecimal (base 16) → Octal (base 8)

Step 1: Expand each digit of 2A (hex) by position:

        2 × 16^1 = 32
        A × 16^0 = 10
        ────────────
        Sum = 42 (decimal)

Step 2: Divide 42 by 8 repeatedly (read remainders upward):

        42 ÷ 8 = 5  r 2
         5 ÷ 8 = 0  r 5
        Read remainders upward: 52

────────────────────────────
Result:  2A (hex) = 52 (oct)

About Hexadecimal

Hexadecimal (base 16) uses digits 0-9 and A-F (A=10, B=11, C=12, D=13, E=14, F=15). Each position is a power of 16: 16⁰=1, 16¹=16, 16²=256. Because 16 = 2⁴, each hex digit = exactly 4 bits (one nibble). Ubiquitous in computing: memory addresses (0x7FFF…), CSS colours (#FF5733), IPv6, SHA-256 hashes (64 hex digits = 256 bits), MAC addresses, UUID/GUIDs, and binary file magic numbers. The '0x' prefix originated in C (1972) and is standard in C++, Java, Python, JS, Rust, and Go. Conversion: decimal 42 = 2×16+10 = 2A₁₆.

About Octal

Octal (base 8) uses digits 0-7. Each position is a power of 8: 8⁰=1, 8¹=8, 8²=64. Because 8 = 2³, each octal digit = exactly 3 binary bits. The Unix/Linux file permission system (chmod 755 = rwxr-xr-x; 7=111, 5=101) uses octal for concise 3-bit rwx triplets. The DEC PDP series encoded 12- and 16-bit words naturally in octal. In C/C++/JS a leading zero denotes octal: 0755 = 493₁₀. Conversion: decimal 42 = 5×8+2 = 52₈.

Quick Reference Table

Hexadecimal (hex)Octal (oct)
11
22
55
810
A12
F17
1020
2A52
40100
64144
FF377

→ Full Number Base Converter