Skip to content

Text to Octal

Convert text into octal character codes.

Quick Tool Overview

Text to Octal converts each character into its base-8 code, padded to three digits so the values line up. A backslash escape format produces output that pastes straight into a C or shell string literal, which is where octal still genuinely appears.

What it does
Converts text into octal character codes
You give it
Any text
You get back
Octal codes, plain or backslash escaped
Best for
C string literals, shell escapes and Unix work
Text Tools Free, unlimited use No sign-up Runs in your browser

About the Text to Octal

Octal is base 8, and it survives in computing mainly through Unix. File permissions are octal — 755 and 644 are octal numbers — and octal escape sequences still appear in C string literals and in older regular expression syntax.

This converts each character of your text into its octal code. Plain ASCII characters produce three octal digits, which is why the padding option matters: padded to three, the codes line up in columns and can be read as a fixed-width stream. There is a backslash escape format for pasting straight into a C or shell string, and both UTF-8 byte and code point modes for the same reason the binary converter has them.

Key features of the Text to Octal

Escape sequence format

Output as \101\102\103, valid in C, C++, Java and most shells.

Three-digit padding

Every code the same width, so an unseparated run can be split back correctly.

Bytes or code points

UTF-8 bytes for escapes, code points for one value per character.

Any separator

Spaces for reading, commas for an array, nothing for a fixed-width stream.

Explains where octal is used

The page says why octal survives — Unix permissions and C escapes — rather than presenting it as arbitrary.

How to use the Text to Octal

  1. 1

    Type or paste your text

    Any text you need in octal.

  2. 2

    Choose bytes or code points

    UTF-8 bytes for escape sequences; code points for one value per character.

  3. 3

    Set the format

    Space separated for reading, or backslash escaped for a C or shell string literal.

  4. 4

    Copy the octal

    Padded to three digits by default, so the codes line up.

Frequently asked questions

Unix file permissions, mainly. Each permission triple — read, write, execute — is exactly three bits, which is one octal digit, so 755 reads directly as rwxr-xr-x. Octal escape sequences also persist in C string literals.

Reviews of the Text to Octal

What people who use the Text to Octal think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Text to Octal. It takes half a minute and no account.

Write the first review

More text tools