Skip to content

Text to Octal Converter

Write your text as base-8 byte values, for example "Hi" → 110 151, or as \110\151 escapes.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Text to Octal Converter?

Octal uses the digits 0–7, so one byte (0–255) fits in exactly three digits, from 000 to 377. It is the notation of Unix file permissions, of older assembly listings and of octal escape sequences such as \101 for "A" in C strings, shell printf and many config files.

This converter encodes your text as UTF-8 and prints each byte as a zero-padded 3-digit octal number. Pick a space, comma, no separator, or the backslash style (\110\151) that string literals accept. Accented letters and emoji become several groups, one per UTF-8 byte.

How does it work?

  1. Type or paste text in the input box.
  2. Choose the format: spaces, commas, one continuous string or backslash escapes.
  3. Copy the octal bytes, or press Swap to decode octal back to text.

Common use cases

  • Writing an octal escape in a C, printf or awk string for a special character.
  • Learning how octal relates to binary and hexadecimal (three bits per digit).
  • Reading octal dumps produced by older tools such as od.
  • Checking the octal value of a control character like newline (012).

Examples

Try this input in the tool above:

Input
Hello, é!
Output
110 145 154 154 157 054 040 303 251 041

Privacy

Text to Octal Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

The numbers are UTF-8 bytes, not Unicode code points. Some languages interpret octal escapes as Latin-1 characters instead, so test in your target language.

Frequently asked questions

Why are there always three digits?

A byte reaches 255, which is 377 in octal. Padding to three digits keeps every group the same width and makes the continuous format unambiguous.

What is the octal code of a newline?

Line feed is 012 (decimal 10) and carriage return is 015. A space is 040.

How does this relate to hex and binary?

One octal digit is three bits, one hex digit is four. The same byte 01001000 is 110 in octal, 48 in hex and 72 in decimal.

More tools in Encoding & Decoding →