Text to Octal Converter
Write text in base 8. Each byte is shown as three octal digits, optionally as backslash escape sequences that work in shell scripts, printf and C strings.
- Runs in your browser
- No sign-up
- Free to use
How to use Text to Octal
- Type or paste text into the left box.
- Choose the separator between bytes.
- Choose a prefix: none, a backslash for escape sequences, or 0o.
- Copy or download the octal output.
Text to Octal features
Three digits per byte
Bytes are padded to three octal digits, from 000 to 377.
Escape sequences
Output such as \110\145\154 for use in printf, echo -e and C or Python strings.
UTF-8 bytes
Non-English characters are encoded as their UTF-8 bytes.
Separator options
Spaces, commas or continuous output.
Live conversion
Updates as you type.
Private
Runs in your browser.
When to use Text to Octal
- Writing octal escapes in shell scripts and printf commands.
- Embedding non-printable bytes in C, Python or Bash strings.
- Studying number bases in computing courses.
- Creating puzzle and cipher messages.
- Interpreting octal dumps produced by the od command.
Text to Octal FAQ
What is octal?
A base-8 number system using digits 0–7. Each octal digit represents three bits.
Why three digits per byte?
A byte has eight bits. Three octal digits cover nine bits, enough for every byte value up to 377 (255 in decimal).
Where is octal still used?
Unix file permissions such as chmod 755, escape sequences in strings, and some legacy systems and data formats.
What does \110\151 mean?
It is “Hi” written as octal escapes: 110 octal is 72 decimal (H) and 151 octal is 105 (i).
How do I convert back?
Use the Octal to Text converter.
How do octal file permissions like 755 work?
Each digit describes one group: owner, group and others. A digit is the sum of 4 for read, 2 for write and 1 for execute, so 7 means all three, 5 means read and execute, and 4 means read only. 755 therefore lets the owner do everything and everyone else read and run the file.
Where is octal still used today?
Mostly in Unix file permissions, where three bits per digit map neatly to read, write and execute: 755 and 644 are octal numbers. It also appears in escape sequences in C-like languages, such as \101 for the letter A, and in some older computer systems and documentation. For general data, hexadecimal has replaced it because two hex digits describe exactly one byte.
Octal: three bits at a time
Octal groups binary digits in threes, just as hexadecimal groups them in fours. It was popular on early computers whose word sizes were multiples of three bits, such as 12, 18 and 36 bits, because every word could be written as a whole number of octal digits.
With the move to 8-bit bytes, hexadecimal became more convenient, since two hex digits fit a byte exactly while octal needs three digits and wastes a bit. Octal survives where groups of three bits are natural. Unix permissions are the best-known case: read, write and execute are three bits, so each of owner, group and others is one octal digit, as in 755.
Octal also lives on in string escapes. In C, Bash, Python byte strings and many other languages, a backslash followed by up to three octal digits inserts the byte with that value. \033, the escape character that starts terminal colour codes, is probably the most typed octal number today.
Converting text to octal shows the same bytes as hex or binary, simply in another base. The letter A is 65 in decimal, 41 in hex, 101 in octal and 01000001 in binary.
To check a result by hand, take one character and divide its code by eight repeatedly, writing down the remainders from last to first. The letter A has code 65: 65 divided by 8 is 8 remainder 1, 8 divided by 8 is 1 remainder 0, and 1 divided by 8 is 0 remainder 1, giving 101.