Text to octal converter

Type text to get its bytes in octal, a form common in Unix commands and escapes such as \110.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter text and separator.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

The text is encoded to UTF-8 bytes, then each byte is written in base 8: 72 = 1 × 64 + 1 × 8 + 0 = 110.

Example

Inputs: Separator = Space. Result: Octal: 110 151; Bytes: 2; Characters: 2.

Hi
110 151

Limits and caveats

  • Each byte is padded to three digits, e.g. 012 for a line break.

Questions about this tool

Why three digits per byte?

The largest byte, 255, is 377 in octal, so three digits fit any byte.

Where is octal used with text?

In C string escapes and in Unix commands such as printf and od.

Does an Arabic letter give two values?

Yes, because it is two bytes in UTF-8, so س gives 330 263.