Hex to Octal
Convert hexadecimal numbers to octal (base 8) and back.
Hex to Octal Converter
Convert hexadecimal (base 16) numbers to octal (base 8) without doing the math through decimal yourself. Paste one number per line and read the results immediately: FF → 377, 1ED → 755, 0x1000 → 10000. The reverse mode converts octal back to hex.
How hex to octal conversion works
Hex and octal are both powers of two, so the easiest path is through binary:
- Write each hex digit as four bits:
1ED→0001 1110 1101. - Regroup the bits into threes from the right:
000 111 101 101. - Replace each group with an octal digit:
0 7 5 5→755.
Going through decimal works as well (0x1ED = 493 = 7 × 64 + 5 × 8 + 5), but the binary method avoids long division. The converter uses exact big-integer arithmetic, so it gives the right answer for numbers of any length.
Why convert between hex and octal?
Hex dominates modern computing, but octal survives in a few important places: Unix file modes and umask values, stat output, tar and cpio archive headers, and octal escape sequences in C strings such as \033 for the escape character (0x1B). When a tool prints a mode in hex (for example 0x81ED from a raw inode) and you need the familiar 100755, this converter does it in one step.
Options
- Prefix – output
0o(octal) or0x(hex) literals. - Uppercase – choose
1EDor1edfor hex output. - Group digits – three-digit groups for octal, four-digit groups for hex.
Fractions (0.8 hex = 0.4 octal) and negative numbers are handled. For a full view across all bases, open the All Number Converter.
Frequently Asked Questions
What is FF in octal?
0xFF (255 in decimal) is 377 in octal.
Is there a direct way to convert hex to octal?
Yes – go through binary. Expand each hex digit to four bits, regroup the bits in threes from the right, and convert each group to one octal digit.
Why would I need octal today?
Mostly for Unix/Linux file permissions (chmod, umask), archive formats like tar, and octal escape sequences in C-style strings.