Octal to Hex Converter
Convert octal (base 8) numbers to hexadecimal (base 16).
Hexadecimal
Output updated — 14 characters
Octal to hex conversion explained
Octal (base 8) and hexadecimal (base 16) are both shorthand for binary, but with different group sizes — 3 bits per octal digit vs 4 bits per hex digit. Converting 377 (octal) gives FF (hex) — both represent 255 in decimal. Hex is the dominant notation in programming (memory addresses, colour codes, byte values), while octal appears in Unix file permissions (chmod 755). For the reverse direction try Hex to Octal, or use the full Base Converter for any radix.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Converting a legacy octal value into the hex form a modern tool expects.
- Reading a permission or a device number quoted in octal against hex documentation.
- Cross-checking two representations of the same value from different systems.
- Converting an octal escape into a hex escape for a different language.
- Working through a base-conversion exercise between two non-decimal bases.
Frequently Asked Questions
- Why not convert digit by digit?
- Because the group sizes do not line up. One octal digit is 3 bits and one hex digit is 4, so there is no digit-to-digit mapping — the number has to go through binary or through its value. Their least common multiple is 12 bits, which is why the pattern only repeats every four hex digits.
- What is octal still used for?
- Unix file permissions, almost exclusively. 755 is three groups of three bits — read/write/execute for owner, group and others — which is precisely why octal fits: each digit is one permission triple, and no other base does that so neatly.
- Why did octal fall out of use?
- Word sizes stopped being multiples of 3. Machines with 12-, 24- and 36-bit words made octal natural; the 8-bit byte made hex natural, since two hex digits are exactly one byte and one octal digit spans byte boundaries awkwardly.
- What does a leading zero mean?
- Octal, in C, Java and older JavaScript — so `010` is 8, not 10. It is a notorious source of bugs in date and IP parsing, which is why modern languages use an explicit `0o` prefix and why strict-mode JavaScript rejects the bare leading zero entirely.
- Is the conversion exact for large values?
- It should be, and only if the tool uses arbitrary-precision arithmetic. Converting through a double silently rounds anything above 2⁵³, so a long octal permissions mask or a large address can come back subtly wrong with no warning.
Common errors and gotchas
- Converting digit by digit. The bases do not align, since three bits per octal digit does not divide into four.
- Missing that any 8 or 9 in the input means it was never octal.
- Losing the leading zero that marked the value as octal, which changes how the source is read.
- Assuming three octal digits map to a fixed number of hex digits, which depends on the value.
- Adding or dropping a prefix that the destination format treats as significant.
Related Converters tools
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to XML
Convert JSON structures into nested XML markup.
HWB to HEX Converter
Convert an HWB color to HEX.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.
CSV to XML
Convert CSV rows into structured XML records.
XML to CSV
Flatten repeated XML records into CSV rows.
INI to JSON
Parse INI config sections and keys into JSON.