Text to Octal and Back

Type text to see each byte that stores it as three octal digits, or paste octal to read it as text. The result appears as you type.

How it works

Text is turned into bytes with UTF-8, the encoding the web uses. Each byte is then written in base 8, from 000 to 377. H is byte 72, which is 110 in octal, and i is byte 105, which is 151.

Plain English letters take one byte each. An accented letter such as é takes two bytes, 303 251, and most emoji take four.

Decoding reads groups split by spaces, commas or line breaks, and lets a group drop its leading zeros, so 12 is read as 012, a line feed. One unbroken run of digits is read three at a time instead. Everything runs on this page.

How to use it

  1. 1 Pick Encode for text to octal, or Decode for octal to text.
  2. 2 Type or paste into the first box. The result appears as you type.
  3. 3 Turn off the space between bytes if you need one long run of digits.
  4. 4 Copy the result or download it as a .txt file. Swap moves the result back into the first box and flips the direction.

Good to know

  • To write a byte as an escape in C, Python or a shell printf, put a backslash before its three octal digits: \101 is A.
  • If decoding says a digit is not octal, look for an 8 or a 9. Octal only uses the digits 0 to 7.
  • This tool converts text. To convert a single number such as 755 to decimal or binary, use the number base converter.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Reading text as octal, one byte at a time

Octal is base 8. It uses the digits 0 to 7, and each place is worth eight times the one to its right. The octal number 151 is 1 × 64 + 5 × 8 + 1, which is 105. In ASCII and UTF-8, byte 105 is the letter i. That is the whole conversion: find the byte, then write it in base 8.

Each octal digit stands for exactly three bits, which is why octal was popular on early computers built from 12-bit, 18-bit and 36-bit words. A byte has eight bits, which does not split evenly into threes, so a byte needs three octal digits, and the first of them is only ever 0 to 3. That is why the largest byte is 377 and not 777. Hexadecimal, with four bits a digit, fits bytes more neatly, and has largely replaced octal for this job.

Octal still turns up in a few places. Unix file permissions are written in octal, as in chmod 644. C, Python and shell printf accept a backslash and three octal digits as an escape for one byte, so \110\151 prints Hi. Older file formats, such as the headers of tar archives, store numbers as octal text. Puzzles and classroom exercises use it too.

Here is a worked example with an accent. The word café is five bytes in UTF-8, because é takes two. c is 99, which is 143 in octal. a is 97, which is 141. f is 102, which is 146. é is the two bytes 195 and 169, which are 303 and 251. So café is 143 141 146 303 251. Paste those groups into the decoder and you get café back.

The tool has limits. It converts text through UTF-8 only, so octal that came from another encoding, such as Latin-1, decodes to the wrong letters or to an error. Octal that came from a file such as a picture does not decode to text, and the tool says so. It takes up to a million characters at a time, which keeps it quick on a phone; split anything longer into parts.

Frequently asked questions

Why does each byte take three octal digits?

A byte holds a value from 0 to 255. In base 8, 255 is 377, which needs three digits, and two digits only reach 77, which is 63. So every byte is padded to three digits: a space, byte 32, is written 040.

Why does é turn into two groups?

UTF-8 stores letters outside plain English in two to four bytes. é is the bytes 195 and 169, which are 303 and 251 in octal. Decoding the two groups together gives é back.

Why does decoding say a group is more than 377?

Three octal digits can reach 777, which is 511, but a byte stops at 255, which is 377. A group such as 400 cannot be one byte, so the tool names it instead of guessing.

Is octal the same as the numbers in chmod 755?

It is the same number system, but a different job. In chmod each digit is three permission bits. Here each group of three digits is one byte of text. For permissions, use the chmod calculator.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.