Octal to Decimal

Convert octal (base 8) numbers to decimal and back.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

Octal to Decimal Converter

Convert octal (base 8) numbers into ordinary decimal numbers and back. Paste one value per line and the results appear instantly: 10 → 8, 17 → 15, 755 → 493, 1000 → 512.

The formula

Every position in an octal number is worth a power of 8, counting from 0 on the right. Multiply each digit by its place value and add everything up. For 1257:

1 × 8³ + 2 × 8² + 5 × 8¹ + 7 × 8⁰ = 512 + 128 + 40 + 7 = 687

Decimal to octal works in reverse: divide by 8 repeatedly and read the remainders backwards.

Octal place values

  • 8⁰ = 1
  • 8¹ = 8
  • 8² = 64
  • 8³ = 512
  • 8⁴ = 4,096
  • 8⁵ = 32,768
  • 8⁶ = 262,144

Common octal numbers explained

  • 644 = 420 – typical file permission for documents (rw-r--r--).
  • 755 = 493 – typical permission for programs and folders (rwxr-xr-x).
  • 777 = 511 – full permissions for everyone.
  • 022 = 18 – the most common umask.
  • 0377 = 255 – the largest byte value.

A note on leading zeros

In C, C++, older JavaScript, and many configuration languages a number with a leading zero, such as 0755, is octal. That trips people up: 010 is 8, not 10. Python 3 and modern JavaScript use the explicit 0o prefix instead. This converter accepts both styles, plus negative numbers, spaces, and underscores.

Options

Turn on Group digits to show large decimal results with thousands separators (1,234,567). In decimal-to-octal mode you can also add a 0o prefix. Fractions are converted as well: 0.4 in octal is 0.5 in decimal. Need hex or binary too? The All Number Converter shows all bases side by side.

Frequently Asked Questions

Multiply each digit by 8 raised to its position (starting at 0 on the right) and add the products. 52 in octal = 5 × 8 + 2 = 42.

In many programming languages a leading 0 marks an octal literal, so 010 means one eight and zero ones, i.e. 8 in decimal.

493. As a Unix permission, 755 is read as three separate digits (rwx r-x r-x), not as a single number.