About Text to Octal Converter
Octal still turns up in C and shell string escapes such as \303\251, in older protocol documents and in file permission habits. This converter writes each UTF-8 byte of your text as a base-8 number from 000 to 377, optionally with a 0o prefix.
In the other direction it reads octal bytes separated by spaces or commas, written as C-style escapes with a backslash, or run together in groups of three, and decodes them as UTF-8 text.
How it works
- Your text is encoded as UTF-8, the encoding used by the web and most files, so plain English letters take one byte and other characters take two to four.
- Each byte is written in the base you choose, padded to a fixed width (two hex digits, eight binary digits, three octal digits) so the output can be read back even without separators.
- With "One number per: Character" each character becomes its Unicode code point instead, so an emoji is one number rather than four bytes.
- Reading numbers back, the tool ignores separators and common prefixes, checks every value, and decodes the bytes as UTF-8, reporting where any invalid sequence starts.
Questions
What is the largest octal value for one byte?
377, which is 255 in decimal. Anything larger cannot be a single byte, so the tool refuses it and names the number.
Can I paste escapes such as \110\151 straight from source code?
Yes. Backslashes and 0o prefixes are treated as separators, so \110\151 reads as the two bytes 110 and 151, which spell Hi.
Why do accented letters give two numbers?
They take two bytes in UTF-8. é, for example, is the bytes 303 and 251 in octal. Plain ASCII characters always take one.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.