Convert Octal to Hex

Enter your octal numbers below—one per line—and get instant hexadecimal conversions. Whether you're working with Unix file permissions (like chmod 755), legacy system configurations, or converting between number bases for programming assignments, this tool simplifies octal-to-hex conversions.

OCTAL

Enter octal (base-8) values to convert

HEXADECIMAL

Outputs hexadecimal (base-16) representation

Loading converter...

How to convert Octal to Hexadecimal - a step by step tutorial

Use binary as a bridge between base-8 and base-16. Learn the 3-bit to 4-bit grouping technique for converting Unix permissions and legacy system values.

How It Works

Converting octal to hex requires going through binary as an intermediate step. Each octal digit = 3 bits, each hex digit = 4 bits.

1

Convert Each Octal Digit to 3-Bit Binary

Replace each octal digit (0-7) with its 3-bit binary equivalent.

755 → 111 101 101

2

Regroup into 4-Bit Nibbles

Group the binary result into sets of 4 bits from right to left. Pad with zeros if needed.

0001 1110 1101

3

Convert Each Nibble to Hex

Replace each 4-bit group with its hexadecimal digit (0-F).

0001=1, 1110=E, 1101=D

4

Combine Result

Write the hex digits together. Add 0x prefix for clarity.

755₈ = 0x1ED₁₆

Unix File Permissions: Octal to Hex

Unix chmod uses octal for file permissions. Converting to hex helps understand the underlying bit patterns for advanced permission analysis.

Understanding chmod Octal Notation

Each octal digit represents permissions for owner, group, and others. Bits: 4=read, 2=write, 1=execute.

Octal
Binary
Hex
Permissions
7
111
0x7
rwx (read+write+exec)
6
110
0x6
rw- (read+write)
5
101
0x5
r-x (read+exec)
4
100
0x4
r-- (read only)
0
000
0x0
--- (no permissions)

Common chmod Values in Hex

OctalHexadecimalMeaning
7550x1EDrwxr-xr-x (standard executable)
6440x1A4rw-r--r-- (standard file)
7770x1FFrwxrwxrwx (full access - insecure)
7000x1C0rwx------ (owner only)
6000x180rw------- (private file)
4440x124r--r--r-- (read-only for all)

Why Convert Octal to Hex

🐧

Linux Permission Analysis

Security audits examine file permissions at the bit level. Converting chmod 755 (octal) to 0x1ED (hex) then to binary (111101101) reveals exact read/write/execute flags. Essential for rootkit detection and security hardening.

📦

Archive File Formats

Tar archives store file permissions in octal. Hex conversion aids in parsing tar headers programmatically. Legacy Unix backup systems (cpio, dump) use octal extensively; hex provides a bridge to modern tools.

🖥️

Legacy System Migration

PDP-11 and VAX systems used octal for memory addresses and machine code. Converting to hex helps port old assembly code to modern architectures. Historical computing hobbyists working with vintage systems need octal-to-hex for documentation.

🔧

Device Driver Development

Some embedded Linux drivers use octal for register configurations. Converting to hex aligns with modern development tools and debuggers that display memory in hexadecimal. Kernel module parameters occasionally require octal-to-hex translation.

📜

Historical Documentation

Classic Unix books (K&R C, Lions' Commentary) use octal notation. Converting examples to hex helps modern programmers understand historical code. Early C escape sequences (\\033 for ESC) were octal; hex equivalents (\\x1B) are clearer today.

💾

Tape & Disk Formats

Magnetic tape formats (9-track, QIC) used octal for block addressing. Hex conversion aids data recovery from legacy media. Filesystem inodes on old Unix systems displayed in octal; hex provides compatibility with modern forensic tools.

Octal to Hex Quick Reference

Single-digit octal conversions and common multi-digit patterns for Unix administration.

Single Digit (0-7)

00x0(000)
10x1(001)
20x2(010)
30x3(011)
40x4(100)
50x5(101)
60x6(110)
70x7(111)

Common Patterns

100x08Octal 10 = 8 decimal
770x3FMax 6-bit value
1000x40Octal 100 = 64 decimal
3770xFFMax byte (255)
10000x200512 decimal
77770xFFF12-bit max (4095)

Octal to Hex: Unix & Legacy Systems FAQs

Why does Unix use octal for file permissions?

Historical reasons: early Unix (1970s) ran on PDP-11 computers that used octal. Each permission bit triplet (rwx = 3 bits) maps perfectly to one octal digit (0-7). This made chmod intuitive: 755 = rwxr-xr-x is easier to remember than binary 111101101 or hex 0x1ED.

How to convert chmod 755 to hexadecimal?

Convert each octal digit to 3-bit binary: 7=111, 5=101, 5=101 → 111101101. Regroup as 4-bit nibbles: 0001 1110 1101. Convert to hex: 1=0x1, 14=0xE, 13=0xD → 0x1ED. So chmod 755 = 0x1ED in hex.

Why can't I use digits 8 or 9 in octal?

Octal is base-8, using only digits 0-7 (like decimal base-10 uses 0-9). Each octal digit represents 3 binary bits, which can only encode values 0-7. If you see "8" in a supposed octal number, it's either a typo or the number is actually decimal.

What's the leading 0 prefix in C octal literals?

In C, a leading 0 indicates octal: int x = 0755; means octal 755 = 493 decimal (not 755 decimal!). To avoid confusion, modern code uses hex (0x1ED) or decimal (493). Always be careful with leading zeros in C—they change the number base.

Why do tar archives use octal in headers?

Tar format was designed in 1979 when octal was standard on Unix. The tar header stores file modes, UIDs, and sizes in octal ASCII strings. Modern tar implementations convert internally, but the on-disk format remains octal for backward compatibility with 40+ years of archives.

Is octal still relevant today?

Mostly for Unix permissions (chmod, umask) and legacy code. Modern programming favors hex for low-level work. However, understanding octal is essential for: system administration, archive file parsing, porting old C code, and working with historical computing documentation. It's niche but not obsolete.

Convert binary numbers to hexadecimal numbers.

Convert decimal numbers to hexadecimal numbers.

Convert denary numbers to hexadecimal numbers.

Convert an RGB color to a hexadecimal color.

OCTAL to hex conversion table.

HEX to octal conversion table.


Have feedback or questions?

Please, do let us know and we'll see what we can do for you.

0/2000