Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)

Unpack a byte from an od dump or an old minicomputer listing into its bit pattern, with padding advice and the three-bits-per-digit rule explained.

Reading an od Dump Down to the Bits

Run od -b on a file and every byte comes back as three octal digits. The habit is older than the byte itself: machines with 12, 18 and 36-bit words split neatly into groups of three bits, so base-8 was the natural shorthand and the Unix tools inherited it. When you need the actual bit pattern behind a dump column, this page unpacks it.

One digit opens into three bits: take them in order. 644 becomes 110, 100, 100, so the byte is 110100100 — nine bits, which is why a file mode fits so tidily.

Two Places Octal Still Prints

Byte Dumps on the Command Line

The default output of od is octal, and plenty of scripts and manual pages still quote bytes that way.

Documentation from Older Machines

Minicomputer manuals list addresses and word contents in base-8; expanding a value is the quickest way to see the fields inside it.

The expansion is also the clearest way to explain why octal and hex disagree: three bits per digit fits a nine-bit permission set, four bits per digit fits an eight-bit byte, and neither one fits both.

From Dump Column to Bit Pattern

1

Type one column of the dump

Digits 0 to 7 are the only ones accepted, which catches a misread 8 or 9 before it turns into a wrong answer.

2

Restore the leading zeros

The bits come back without padding and spaced in fours. For a byte, write the pattern out to eight positions yourself before you compare it with anything.

3

Take the pattern with you

Copying the binary field returns the bits joined together behind 0b, ready to paste into a calculator, a test case or a comment.

Rebuilding the dump value: enter a bit pattern in the lower field and the octal column reappears above. Swap opens the binary-first page and takes the value along.

Octal Dumps and Machine Word Bits

The middle column is what this page prints; the one beside it is the same value padded to a full byte, which is how the data actually sits on disk.

od columnOutput herePadded byteMeaning
00711100000111Bell character
012101000001010Line feed
04010000000100000Space
101100000101000001Capital A
2001000000010000000High bit alone, the start of non-ASCII
3771111111111111111Every bit set, the largest byte

Eights and Nines Are Refused

Those digits do not exist in base-8, so they never enter the field — a free check on any column you transcribe by hand.

Bits Shown in Fours

The output is spaced in nibbles even though the input grouped in threes, which makes the mismatch between the two bases visible on screen.

Full Words Convert Cleanly

A six-digit machine word such as 177777 expands to all sixteen bits at once, and longer values keep their precision through big-integer arithmetic.

Questions About Octal Dumps

Can I paste a whole dump line into the field?

The spaces are removed on entry, so several columns would run together into one huge value. Feed the columns separately if you want each byte's bits.

How many bits does a six-digit octal word hold?

Up to eighteen, but the classic 16-bit ceiling is 177777, which converts to sixteen ones and equals 65535. Anything larger than that would not have fitted in a minicomputer word.

Why did older machines prefer base-8 to base-16?

Their word sizes divided by three, not by four, and an octal digit needs no extra symbols beyond the ten we already have. Once eight-bit bytes became standard, four-bit digits fitted better and hex took over.

Why is the leading zero of 012 missing from the bits?

Because it adds nothing to the value. The output is the shortest pattern that represents the number, so you decide whether it is drawn as a byte, a word or a nine-bit mode.

Does an octal dump show the same order as memory?

Byte-oriented output such as od -b follows the file exactly. Word-oriented modes group two bytes at a time and follow the machine's own ordering, so the columns can look reversed against the raw bytes.

01234567
0o
01
0b

Bytes from an od Dump

007 = 111
012 = 1010
040 = 100000
101 = 1000001
200 = 10000000
377 = 11111111

Octal (Base-8)

The shorthand a dump column uses, three digits per byte and no letters to remember.

Binary (Base-2)

The pattern underneath, which you pad to a byte or a word depending on what the data really is.

Convert one dump column at a time, spaces are stripped
644 opens into 110 100 100
Pad the answer to eight positions to see a real byte
Digits 8 and 9 are refused, which catches transcription slips
Want to learn more? Read documentation →
1/5
Start typing to search...
Searching...
No results found
Try searching with different keywords