Developer tools

Text to Octal

Text to Octal Converter

Convert text to octal (base 8) bytes or code points and octal back to text.

About this tool

About Text to Octal

Write text as base-8 numbers, the format behind C and shell octal escapes like \110\151, Unix file permissions and some older protocols. Each character is encoded as UTF-8 and every byte becomes a three-digit octal number from 000 to 377, so H is 110 and i is 151. Turn padding off for minimal digits, add a 0o prefix for JavaScript or Python literals, and choose the separator: spaces, commas, new lines or nothing. Switch Values are to Code points if you want each character's Unicode number in octal rather than its bytes. Decoding accepts octal separated by spaces or punctuation, C-style backslash escapes and 0o prefixes, and splits an unbroken run into three-digit groups. Values above 377 in byte mode are flagged, because they can't be a single byte. It is a quick way to read escaped strings in logs and source code, and it runs entirely in your browser.

Built and maintained by Abhi JainUpdated

How to Convert Text to Octal

  1. 1

    Choose the direction

    Pick Text → Octal, or Octal → Text to decode.

  2. 2

    Format the output

    Choose UTF-8 bytes or Code points, a Separator, Pad to 3 digits and the 0o prefix.

  3. 3

    Type and copy

    Type your text and copy or download the octal, or click Swap to decode it again.

Text to Octal: questions and answers

How do you convert a letter to octal?

Take its code (A is 65) and divide by 8 repeatedly: 65 = 1×64 + 0×8 + 1, so A is 101 in octal. The tool does this for every byte.

Why is the largest octal byte 377?

A byte holds 0–255, and 255 in base 8 is 3×64 + 7×8 + 7 = 377.

How do I read \110\145\154\154\157?

Those are C-style octal escapes. Paste them into Octal → Text and they decode to 'Hello'.

Where is octal still used?

Mainly for Unix file permissions (chmod 755), escape sequences in C, shells and some config formats, and in older systems with 12-, 24- or 36-bit words.

Ready-made Text to Octal presets