๐ข Hex to Octal Converter with Steps
By Shihab Mia ยท Updated 2026-07-27
A leading 0x and spaces are ignored. Only the digits 0-9 and letters A-F are allowed.
| Hex digit | Decimal | 4-bit binary |
|---|
This hex to octal converter turns any hexadecimal number into its base 8 value in one step, so FF becomes 377 and 1A becomes 32. It also shows the matching decimal (FF is 255) and binary (FF is 11111111) values, plus a digit-by-digit breakdown of how each hex digit maps to four binary bits. Everything runs in your browser and stays exact for very long inputs thanks to BigInt, well past the 8 or 16 hex digits most calculators stop at.
What is the Hex to Octal Converter?
Hexadecimal (hex) is a base 16 number system. It uses the ten digits 0 to 9 plus the six letters A to F, where A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15. Octal is a base 8 system that uses only the digits 0 to 7. Both are shorthand for binary: one hex digit stands for exactly four binary bits (a nibble), and one octal digit stands for exactly three binary bits. Because the two systems group binary into different chunk sizes, you cannot map a single hex digit straight to a single octal digit. The reliable route is to go through a shared base, and the value itself is easiest to reason about in decimal or binary.
To convert hex to octal by hand, the clearest method has two stages. First convert the hex number to its plain decimal value by multiplying each digit by a power of 16 and adding the results. For FF that is 15x16 + 15x1, which equals 240 + 15 = 255. Second, convert that decimal value to octal by repeatedly dividing by 8 and reading the remainders from bottom to top. Dividing 255 by 8 gives 31 remainder 7, then 31 by 8 gives 3 remainder 7, then 3 by 8 gives 0 remainder 3. Reading the remainders upward gives 377, so FF in hex equals 377 in octal.
There is a faster route that avoids decimal entirely. Expand every hex digit into its 4-bit binary nibble, join the bits into one long binary string, then regroup those bits into threes starting from the right and read each group as an octal digit. FF expands to 1111 1111, an 8-bit string. Padded on the left to a multiple of three it becomes 011 111 111, and those groups read as 3, 7, 7, which is 377 again. This binary bridge is exactly how computers move between the two bases, and it is why the converter above prints the binary form and the per-digit nibble table.
Standard JavaScript number math is only exact up to 53 bits, so a naive parseInt starts to drift on long hex strings like a 64-bit register value. This tool parses the input with BigInt, so the octal, decimal and binary results stay exact no matter how many hex digits you paste. Whether you are checking a one-byte value such as FF, converting a color code, or decoding a long memory address, the hex to octal result you see is the true value and not a rounded approximation.
Octal survives today mostly in places where grouping bits into threes lines up naturally with hardware or with older conventions, even though hex has replaced it almost everywhere else. Unix and Linux file permission strings such as chmod 755 are octal, because a permission set is 9 bits (read, write, execute for owner, group and others), and 9 bits split evenly into three octal digits with no leftover bits. Some older minicomputers (the PDP-8 and PDP-11 among them) and a handful of legacy protocols and escape-sequence conventions in C-family languages also default to octal, which is why a hex to octal converter still comes up in systems programming and retrocomputing work even though most modern tooling favors hex or decimal.
It is worth being precise about scope: this tool converts whole (integer) hexadecimal values. Hexadecimal numbers with a fractional part after a point convert the same way in principle, integer part via division by 8 and fractional part via repeated multiplication by 8, but that is a different procedure from the one shown here and is easy to get wrong by hand, so treat fractional conversions as a separate calculation. Likewise, this tool treats input as an unsigned magnitude; if you are converting a signed or twos complement hex value (common in embedded and low-level work), decide on the bit width and sign convention before you convert, since the octal representation of a negative number depends entirely on that choice.
When to use it
- Converting a hexadecimal value such as FF or 1A to octal for a homework or exam answer.
- Translating a hex memory address, permission mask, or register dump into the octal notation some Unix tools expect.
- Working out a chmod-style Unix file permission value when you already know the permission bits in hex or binary.
- Teaching or learning how base 16, base 8, and base 2 relate, using the live nibble breakdown.
- Cross checking a hex value against its decimal and binary forms while working on low level or embedded code.
- Reading legacy documentation, retrocomputing projects, or older protocol specs that report values in octal.
How to use the Hex to Octal Converter
- Type or paste a hexadecimal number (0-9 and A-F, an optional 0x prefix is fine) into the input box, or tap an example button.
- Read the octal value at the top; it updates instantly as you type.
- Check the conversion path line and the nibble table to see how each hex digit maps to binary and octal.
- Use the copy buttons to grab the octal, decimal, or binary result for use elsewhere.
Formula & method
Worked examples
Convert the hexadecimal number FF to octal.
- Read the hex digits: F is 15 and F is 15.
- Find the decimal value: 15x16 + 15x1 = 240 + 15 = 255.
- Divide by 8 and track remainders: 255 / 8 = 31 r7, 31 / 8 = 3 r7, 3 / 8 = 0 r3.
- Read the remainders from bottom to top: 3, 7, 7.
Result: FF in hex equals 377 in octal (decimal 255, binary 11111111).
Convert the hexadecimal number 1A to octal using the binary shortcut.
- Expand each hex digit to 4 bits: 1 is 0001 and A is 1010.
- Join the nibbles into one binary string: 00011010, which is the value 11010.
- Group the bits into threes from the right, padding the left with zeros: 011 010.
- Read each group as an octal digit: 011 is 3 and 010 is 2, giving 32.
Result: 1A in hex equals 32 in octal (decimal 26, binary 11010).
Convert the hexadecimal number 2BC to octal.
- Read the hex digits: 2 is 2, B is 11, C is 12.
- Find the decimal value: 2x256 + 11x16 + 12x1 = 512 + 176 + 12 = 700.
- Divide by 8 and track remainders: 700 / 8 = 87 r4, 87 / 8 = 10 r7, 10 / 8 = 1 r2, 1 / 8 = 0 r1.
- Read the remainders from bottom to top: 1, 2, 7, 4.
Result: 2BC in hex equals 1274 in octal (decimal 700, binary 1010111100).
Hex digit to decimal and 4-bit binary reference
| Hex | Decimal | Binary (4-bit) |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
Common hex values with their octal, decimal, and binary equivalents
| Hex | Octal | Decimal | Binary |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 8 | 10 | 8 | 1000 |
| A | 12 | 10 | 1010 |
| F | 17 | 15 | 1111 |
| 10 | 20 | 16 | 10000 |
| 1A | 32 | 26 | 11010 |
| 40 | 100 | 64 | 1000000 |
| 64 | 144 | 100 | 1100100 |
| FF | 377 | 255 | 11111111 |
| 100 | 400 | 256 | 100000000 |
| 3FF | 1777 | 1023 | 1111111111 |
Unix chmod-style permission values: hex, octal, and meaning
| Hex | Octal | Permission (owner/group/other) | Meaning |
|---|---|---|---|
| 1FF | 777 | rwxrwxrwx | Full read, write, execute for everyone |
| 1ED | 755 | rwxr-xr-x | Owner full access, others read and execute only |
| 1A4 | 644 | rw-r--r-- | Owner read and write, others read only |
| 180 | 600 | rw------- | Owner read and write, no access for anyone else |
| 1FC | 774 | rwxrwxr-- | Owner and group full access, others read only |
Common mistakes to avoid
- Mapping one hex digit straight to one octal digit. A hex digit is 4 bits but an octal digit is only 3 bits, so they do not line up one to one. You must go through the actual value (via decimal or binary), not swap digits in place.
- Forgetting that A to F are digits, not decorations. In hex the letters A, B, C, D, E and F stand for 10, 11, 12, 13, 14 and 15. Treating F as anything other than 15 breaks the whole conversion.
- Grouping binary bits from the left instead of the right. When you use the binary shortcut, group the bits into threes starting from the rightmost bit and pad the left with zeros. Grouping from the left shifts every octal digit and gives the wrong answer.
- Trusting plain number math on long hex strings. Standard JavaScript numbers lose precision beyond 53 bits, so a long hex to octal conversion can drift. This tool uses BigInt so the octal result stays exact for any length you enter.
- Applying the whole-number method to a hex value with a fractional part. A hex number after a decimal point (a fraction) converts by repeated multiplication by 8, not by the division-by-8 method used for whole numbers. Mixing the two methods gives a nonsense result.
- Assuming the octal result is signed the same way the hex value was. If a hex value represents a negative number in twos complement, converting the raw digits to octal does not automatically preserve that meaning. Decide the bit width and sign convention first, then convert.
Glossary
- Hexadecimal
- A base 16 number system using the digits 0-9 and the letters A-F, where A is 10 and F is 15. Each digit represents 4 binary bits.
- Octal
- A base 8 number system using only the digits 0-7. Each octal digit represents exactly 3 binary bits.
- Nibble
- A group of 4 bits, which is exactly what a single hexadecimal digit encodes. Two nibbles make one byte.
- Radix
- Another word for the base of a number system: 16 for hex, 8 for octal, 10 for decimal and 2 for binary.
- Prefix
- A marker that shows which base a number is written in, such as 0x for hexadecimal and 0o for octal. This tool ignores an optional 0x prefix on input.
- BigInt
- A JavaScript number type that holds integers of unlimited size exactly, so long hex inputs convert without rounding errors.
- Positional notation
- A way of writing numbers where each digit's value depends on its position, multiplied by a power of the base. It is what lets a hex digit contribute 16<sup>position</sup> to the total value.
- chmod
- The Unix and Linux command that sets file permissions, conventionally written with three octal digits (owner, group, other), such as chmod 755.
Frequently asked questions
How do you convert hex to octal?
Convert the hex number to its decimal value first, then divide that value by 8 repeatedly and read the remainders from bottom to top. For example FF is 255 in decimal, and 255 in octal is 377. A faster route is to expand each hex digit to 4 bits and regroup the bits into threes from the right.
What is FF in octal?
Hexadecimal FF equals 377 in octal. FF is 255 in decimal (15x16 + 15), and 255 written in base 8 is 377.
What is 1A in octal?
Hexadecimal 1A equals 32 in octal. 1A is 26 in decimal (1x16 + 10), and 26 written in base 8 is 32.
Why can you not convert each hex digit directly to one octal digit?
A hex digit encodes 4 bits while an octal digit encodes only 3 bits, so the boundaries do not align. You have to convert through the number value or the binary bit string rather than swapping digits one for one.
Can this converter handle very long hexadecimal numbers?
Yes. This hex to octal converter uses BigInt internally, so it keeps the octal, decimal and binary results exact for hex strings well beyond 53 bits, unlike simple calculators that round large values.
Does the tool accept a 0x prefix and lowercase letters?
Yes. A leading 0x or 0X is stripped automatically, spaces are ignored, and lowercase a-f are accepted and treated the same as uppercase A-F.
Why do Unix file permissions use octal instead of hex?
A Unix permission set is 9 bits (read, write, execute for owner, group and others), and 9 bits split evenly into three 3-bit octal digits with nothing left over. Hex groups bits in fours, so it does not divide 9 bits evenly, which is why commands like chmod 755 use octal.
How many octal digits do you need for a given number of hex digits?
It depends on the value, not a fixed ratio, because 4-bit and 3-bit groupings do not align cleanly. As a rough guide, 2 hex digits (8 bits) need up to 3 octal digits, and 4 hex digits (16 bits) need up to 6 octal digits, but the exact count depends on the leading bits of the specific number.
Is octal still used in modern computing?
Rarely for general purpose work; hexadecimal and decimal dominate modern programming and documentation. Octal mainly survives in Unix and Linux file permission notation (chmod), some legacy hardware and protocol specs, and older systems such as the PDP-8 and PDP-11.
Does this tool convert hexadecimal fractions or negative hex values?
No, it converts whole (integer, unsigned) hexadecimal values. Fractional hex numbers use a different multiply-by-8 method, and negative or twos complement values need a fixed bit width and sign convention decided before conversion, so those cases are outside the scope of a straightforward digit conversion like this one.