Skip to main content
Data / Number / Computer Science Tools

Octal Converter

Convert between octal and decimal (and binary/hex) - exact conversion for arbitrarily large numbers.

Enter a number in any base below - this tool converts it to and from octal (base 8) accurately.

Edit either field - the other updates automatically. Supports integers up to JavaScript's safe integer limit (2^53-1).

For dedicated binary/hex converters, see the Binary to Decimal and Hex to Decimal Converters - or the general Number Base Converter for any base.

What Is Octal?

Octal (base 8) uses digits 0-7, where each position represents a power of 8 - historically common in computing (especially Unix file permissions, like chmod 755) because it maps cleanly onto groups of 3 binary bits.

How to Use It

  1. Enter a number and select its current base (octal, decimal, binary, or hex).
  2. Select the target base.
  3. The converted value appears instantly, with invalid digits for the selected base flagged clearly.

Limitations

This handles non-negative integers accurately using BigInt for arbitrarily large values - fractional values aren't supported, since octal fractions require a different interpretation than whole-number octal.

Example: Unix Permissions

Octal's best-known use is file permissions. In chmod 754, each digit is three bits:

OctalBinaryPermission
7111rwx (read, write, execute)
5101r-x (read, execute)
4100r-- (read only)

So 754 means the owner can do everything, the group can read and run, and others can only read. The chmod Calculator does this translation for you.

Converting Octal to Decimal

755 in octal = 7 × 64 + 5 × 8 + 5 × 1 = 448 + 40 + 5 = 493 in decimal.

Octal in Programming

  • Python and modern JavaScript write octal as 0o755.
  • C, and older JavaScript, treat a leading zero as octal: 010 is 8, which causes real bugs when numbers such as postcodes are stored with a leading zero.
  • Octal escape sequences such as \033 (the escape character, 27) appear in terminal colour codes.

Read our guide to Linux file permissions, or convert between any bases with the Number Base Converter.

Frequently Asked Questions

Mainly in Unix file permissions, such as chmod 755, where each octal digit represents three permission bits.

Each octal digit is exactly 3 binary digits, so 7 = 111 and 755 = 111 101 101.

Only 0-7. A digit 8 or 9 means the number is not octal.
Share this tool: