Hexadecimal and octal converter

Convert hex to octal or octal to hex with BigInt. Shows decimal, grouped binary and step-by-step conversion (successive divisions). Includes mode toggle and examples.

Hex to Octal Calculator Online (Step-by-Step)

Convert between hexadecimal and octal instantly with BigInt. Validate digits, see decimal and binary equivalents, and follow every conversion step.

Supports 0x / 0o prefixes and underscores as separators.

Octal

Decimal

Normalized binary

Calculated steps

1) Expand to decimal

    2) Decimal to octal

      Quick notes

      • Each hex digit equals 4 bits. Group binary in 3-bit blocks to get octal.
      • If a digit larger than 7 appears in octal mode, you will see an error instantly.
      • Big numbers are handled with BigInt so there is no precision loss.

      How to convert hexadecimal to octal

      The fastest path goes through decimal: treat each digit as a power of its base, sum, and divide by the destination base. The normalized binary (4-bit blocks for hex, 3-bit blocks for octal) gives you a visual double-check.

      Hex → Octal step by step

      1. Clean the input. Allow the 0x prefix and underscores; drop anything outside 0-9 and A-F.
      2. Expand to decimal. Multiply each digit by 16^position from right to left, mapping A-F to 10-15.
      3. Divide by 8. Keep each remainder until you reach 0; the reversed remainders form the octal output.
      4. Check with binary. Group the binary in 3-bit blocks and confirm each block matches an octal digit.

      Example 0x3FA → octal: decimal = (3×16²) + (15×16¹) + (10×16⁰) = 1022. Dividing by 8: 1022 ÷ 8 = 127 r6, 127 ÷ 8 = 15 r7, 15 ÷ 8 = 1 r7, 1 ÷ 8 = 0 r1. Result: 01776.

      Octal → Hex in quick steps

      1. Validate octal. Only 0-7 are allowed; strip any 0o prefix and underscores.
      2. Lift to decimal. Multiply each digit by 8^position and add the results.
      3. Divide by 16. Store remainders (0-9, A-F) until the quotient is 0, then read them in reverse.
      4. Verify in binary. The normalized binary in 4-bit blocks should match each hex digit.

      Example 0o7516 → hex: decimal = (7×8³)+(5×8²)+(1×8¹)+(6×8⁰) = 3918. Dividing by 16: 3918 ÷ 16 = 244 rE, 244 ÷ 16 = 15 r4, 15 ÷ 16 = 0 rF. Result: 0xF4E.

      Frequently asked questions

      What inputs are valid in each mode?

      In hex mode we accept digits 0-9 and A-F/a-f, optionally with a 0x prefix and _ separators. In octal mode only 0-7 are allowed, with an optional 0o prefix.

      How are large numbers handled?

      We rely on BigInt so extremely long values stay exact. The normalized binary view lets you visually confirm the conversion.

      Why does the main label change?

      The primary label updates with the selected mode (Hex → Octal or Octal → Hex) so you always know the target base. Decimal and normalized binary are recalculated in both directions.

      Can I enter negative or decimal numbers?

      This tool is built for unsigned integers in both bases. If you include a minus sign or decimal point you will get a validation error.

      How do I use the normalized binary to verify?

      In hex mode, group the binary in 4-bit blocks; in octal mode, use 3-bit blocks. If every block matches the displayed digit, the conversion is correct.