Skip to content

Convert octal to text

Decode base-8 byte values into readable text, in either direction, with padded or unpadded groups and UTF-8 or ASCII output.

  • Runs in your browser
  • Nothing you enter is sent
  • Free, no account
Octal → Text
Conversion runs as you type. Use Swap to send the result back into the input and reverse the direction.

The converted value appears here.

Options

Accents, CJK and emoji become multiple bytes each, exactly as they are stored on disk.

Applies to the generated output. Input is parsed with or without separators.

Load a text file
Drop a .txt containing octal values and they are parsed straight away.
Drop a file hereRead locally with the File API — nothing is uploaded.Any file · up to 64 MB each

Base 8, three bits at a time

Octal uses the digits 0–7, and each digit represents exactly three bits. That neat division is why it survived: machines with 12, 24 and 36-bit words split cleanly into octal digits, while hex — four bits per digit — did not. Once 8-bit bytes won, hex became the natural fit and octal retreated to a few specific corners.

CharacterOctalDecimalHex
A1016541
a1419761
00604830
space0403220
line feed012100A
maximum byte377255FF

Three digits per byte

A byte needs three octal digits, because 377 is the largest value. That is why unspaced input has to be a multiple of three characters: 101 145 154 is unambiguous, 101145154 only parses if every value was padded. If you get a length error, the likely cause is an unpadded small value — 12 where 012 was meant.

Where octal still appears

  • Escape sequences. \101 in C, Python and many regex flavours is the character A. Perl, sed and printf all understand the same form.
  • File permissions. chmod 755 is octal — but it encodes permission bits, not characters. Our chmod calculator is the tool for that.
  • Legacy protocols and hardware. PDP-11 lineage documentation, some industrial controllers, and a few network standards are written entirely in octal.
  • Unix tooling. od -c and od -b still print octal by default, which surprises everyone who expected hex.

The leading-zero trap

In old C, a leading zero meant octal — so 010 was 8, not 10. That silent reinterpretation caused enough real bugs that modern languages have retired it: Python 3 rejects 0o-less leading zeros outright, and JavaScript treats them as an error in strict mode. Today the explicit 0o prefix is the correct form, and this tool accepts it on input and can add it on output.

Converting octal by hand

Easiest via binary. Write each octal digit as three bits, concatenate, then regroup into bytes:

110 145 154 154 157
= 001001000 001100101 001101100 001101100 001101111
regrouped into 8-bit bytes:
= 01001000 01100101 01101100 01101100 01101111
= 72 101 108 108 111
= "Hello"

Going the other way, take the bits three at a time from the right.

Questions

Why is octal still used at all?

Unix file permissions, some escape sequences in C and Python (\101 is A), and older hardware documentation. Three bits map to one octal digit, which suited machines with 12, 24 and 36-bit words.

How many digits per byte?

Three, because a byte reaches 377 in octal. That is why unspaced input has to be a multiple of three digits — 101 145 154 is unambiguous, 101145154 only parses if you pad every value.

What does the 0o prefix mean?

It is the modern literal prefix for octal in Python, JavaScript and Rust. A bare leading zero used to mean the same thing in C, which caused enough bugs that most languages have retired it.

Is this the same as a chmod value?

No — related but different. chmod octal encodes permission bits, not characters. Use the chmod calculator for that; this page converts octal byte values to and from text.