What is Text to Octal?
Text to Octal turns text into base-8 byte values. Each character becomes a three-digit octal number, the kind you see in Unix permissions and C escape sequences.
Each character becomes a base-8 number. By default the tool encodes UTF-8 bytes — three octal digits cover one byte (000 through 377), which is why Unix chmod still uses octal for file permissions and why C, Python, and shell scripts accept \nnn escapes for non-printable bytes. A code-point mode is available if you need the raw Unicode value as a single octal number. The tool reverses both modes: paste octal back in, validate it against octal digits 0-7, and recover the original text.
How to use
- Type or paste the text you want to convert to octal in the input field.
- Choose the encoding (UTF-8 bytes or raw code point), a delimiter (space, comma, dash, or newline), a prefix style (none, \NNN, 0o, or %), and whether to pad with leading zeros.
- Copy the octal output for your scripts or docs. Flip to reverse mode to convert octal back to text.
When to use
- Embedding non-printable characters into a C string literal as \\NNN escapes.
- Decoding a config file or log line where bytes were dumped in octal form.
- Teaching how UTF-8 bytes split across multiple octal triplets for non-ASCII text.
Result
Enter 'Hello' and get '110 145 154 154 157' (space-delimited) or '\\110\\145\\154\\154\\157' (backslash-prefixed for C strings).
FAQ
- Why does a character like é produce two octal numbers?
- Anything outside the ASCII 0-127 range is stored as multiple UTF-8 bytes. The letter é is two bytes (0xC3 0xA9), which the tool prints as 303 251 in octal. ASCII characters always stay one byte.
- What's the difference between padded and unpadded output?
- Padded keeps every byte at three digits (a space becomes 040, not 40), which matches the fixed-width \\NNN syntax used by C string escapes. Unpadded drops leading zeros and reads slightly cleaner but is ambiguous in source code.
- What do the prefix styles (\110, 0o110, %110) do?
- They wrap each octal token so you can paste it straight into code. Backslash (\110\145…) drops into C, C++, and shell string literals and compiles back to the original text. 0o110 is a runnable octal literal in Python and JavaScript. %110 mirrors percent-notation for cross-checking against URL-encoded values. Leave it on None for a plain, human-readable list.
- How is this different from chmod permission numbers?
- chmod uses octal for a different reason: each digit packs three permission bits (read, write, execute) for one user class. The math is octal, but it's encoding bit flags, not text characters.
- Can I paste octal output from od or hexdump and decode it?
- Yes. Switch to reverse mode and paste the octal triplets separated by spaces, commas, newlines, or with leading backslashes. The tool rebuilds the original text, including multi-byte UTF-8 sequences. Any group with a digit 8 or 9, or any value above 0377 in UTF-8 mode, is flagged inline so you can fix copy-paste errors instantly.
Related Tools
Rhyme Finder
Find perfect and near rhymes for any word
Anagram Solver
Find all valid anagrams of any word
Unicode Lookup
Search Unicode by name or code
URL Encoder/Decoder
Encode and decode URLs instantly
NATO Phonetic Alphabet
Convert text to NATO phonetic alphabet
Paragraph Counter
Count paragraphs in your text