Decimal ↔ Octal Converter

Convert between decimal (base 10) and octal (base 8) instantly

Octal (base 8) is used most commonly in Unix/Linux file permissions via the chmod command (chmod 755) and in some legacy computing systems. This converter helps you switch between decimal and octal instantly.

Loading calculator...

How It Works

1
Select your source number system (Decimal or Octal) from the dropdown
2
Enter your number in the input field — conversion happens instantly
3
View the result in the target number system
4
Use the Swap button to reverse the conversion direction
5
Copy the result to your clipboard with one click
6
Clear the input to start a new conversion

The Decimal-Octal Formula

How to convert between decimal and octal

Formula

Octal = Decimal ÷ 8 repeated (remainders) | Decimal = Σ(Octal digit × 8^position)

Variables

8^n

Powers of 8

Octal is base-8, so each digit represents a power of 8. The rightmost digit is 8⁰ (value 1), next is 8¹ (8), 8² (64), 8³ (512), 8⁴ (4096), and so on.

Octal digits: 0-7

Octal Digits

Octal uses digits 0 through 7. It does not use 8 or 9, or any letters. If you see digits 8 or 9 or letters, it is not a valid octal number.

Division by 8

Decimal to Octal Conversion

Repeatedly divide the decimal number by 8, recording remainders (0-7). Read remainders from bottom to top to get the octal number.

Note: Decimal to octal conversion is most commonly used for Unix/Linux file permissions. The chmod command uses octal numbers to set read/write/execute permissions for owner, group, and others.

Step-by-Step Example

Converting decimal 493 to octal

1

Divide 493 by 8

493 ÷ 8 = 61 remainder 5

2

Divide quotient 61 by 8

61 ÷ 8 = 7 remainder 5

3

Divide quotient 7 by 8

7 ÷ 8 = 0 remainder 7

4

Read remainders from bottom to top

Remainders: 7, 5, 5 → 493 decimal = 755 octal

Reference Guide

unitvaluenote
Decimal: 255377Maximum 3-digit octal (chmod 777)
Decimal: 493755Common for web directories (755)
Decimal: 511777Full permissions (rwxrwxrwx)
Decimal: 384600Owner read/write only (rw-------)
Decimal: 420644Common for files (rw-r--r--)
Decimal: 292444Read-only for all (r--r--r--)

Understanding chmod

How octal numbers control file permissions

👤 Owner (first digit)

The first digit sets permissions for the file owner. This is the most important digit because the owner has full control over permissions they can grant themselves.

Best for: Owner permission values: 4 = read (r), 2 = write (w), 1 = execute (x). Sum them for combinations: 6 = read+write (rw-); 7 = read+write+execute (rwx); 5 = read+execute (r-x); 4 = read-only (r--).

👥 Group (second digit)

The second digit sets permissions for users in the group associated with the file. This is important for collaborative work where multiple people in the same team need consistent access.

Best for: Common group settings: 5 (r-x) for cd into directories; 4 (r--) for read-only files; 0 (---) for restricting access entirely.

🌍 Others (third digit)

The third digit sets permissions for everyone else (any user on the system who is not the owner and not in the group). These are the "public" permissions.

Best for: Web directories typically use 5 (r-x) or 7 (rwx). Web files typically use 4 (r--) or 6 (rw-). 0 (---) completely restricts public access.

Advertisement

Why Octal is Used for File Permissions

Unix and Linux systems represent file permissions as a 3-digit octal number because each permission type can be represented as a binary flag, and octal conveniently groups three binary bits into a single digit. Each permission has a binary value: read (r) = 4 (100 in binary), write (w) = 2 (010), execute (x) = 1 (001). The sum gives the octal digit: rwx = 4+2+1 = 7, rw- = 4+2+0 = 6, r-x = 4+0+1 = 5, r-- = 4+0+0 = 4, and so on. A full permission set is written as three octal digits: the first digit for the owner, the second for the group, and the third for others. For example, 755 means: owner has rwx (7), group has r-x (5), others have r-x (5). This system was invented by Dennis Ritchie and Ken Thompson during the early development of Unix at Bell Labs in the 1970s. The choice of octal over decimal was deliberate because octal aligns perfectly with the 9 binary permission flags (3 permissions × 3 user classes = 9 bits).

Key Features

Real-time conversion as you type — no button pressing required
Swap between decimal and octal with one click
Copy results to clipboard instantly
Support for large numbers up to 64-bit
Instant validation of valid digits
Mobile responsive design
Step-by-step conversion explanation
View in all number systems (Binary, Decimal, Hex, Octal)
Built-in chmod permission reference guide

💡 Pro Tips

  • In Linux/Unix, 755 (rwxr-xr-x) is the standard for directories, allowing the owner full access and everyone else only read and execute.
  • The chmod command also works with symbolic notation: chmod u=rwx,g=rx,o=rx is the same as chmod 755.
  • Web servers like Apache require directory execute permissions (5 or 7) to 'traverse' into directories, even if files inside are readable.
  • Never use 777 on a production web server if you don't have to — it allows any system user to write to your files, which is a significant security vulnerability.
  • When you need to find what octal permissions you need, use the decimal value from ls -l and convert it to octal using this calculator.

Common Mistakes

Using digits 8 or 9 in octal numbers

Octal only uses digits 0 through 7. Any number containing 8 or 9 is not a valid octal number. The converter will show an error if you try this.

Confusing chmod 755 vs 775

755 means owner=rwx, group=rx, others=rx. 775 means owner=rwx, group=rwx, others=rx. 775 allows group members to write, which may be too permissive in some environments.

Setting execute permissions on regular files unnecessarily

Only directories and executable files (programs, scripts) need execute permission. Setting execute on regular files can sometimes cause security warnings in some systems.

Using 000 when you mean to restrict all access

000 (no permissions) works but be aware that the root user can still access the file. For complete restriction, consider additional security measures like SELinux or AppArmor.

Research & Citations

All factual claims on this page are sourced from peer-reviewed research

  1. [1]

    Ritchie, D., Thompson, K. (1974). The UNIX Time-Sharing System. Communications of the ACM, 17(7), pp. 365–375.

    Original paper describing Unix file permissions and the octal representation system

  2. [2]

    Linux Man Pages (2024). chmod — Change file mode bits. linux.die.net.

    Official chmod manual page with octal permission documentation

    View source
  3. [3]

    FreeBSD Documentation Project (2024). File Permissions — An Introduction. freebsd.org.

    Explanation of octal permissions in Unix-like systems

    View source

This calculator is a reference tool and does not constitute medical advice. For personalised sleep health guidance, consult a qualified healthcare provider.

Last updated: January 10, 2025

C

Creators

CalcPool Team

Developer

Advertisement

Quick Facts

CategoryDigital
Total uses0
Last updated2025-01-10
Cost Free
Advertisement

Privacy Guaranteed

Your data never leaves your browser. All calculations are 100% private.

Frequently Asked Questions

What is octal used for?

Octal (base 8) is most commonly used in Unix/Linux file permissions via the chmod command. It is also used in some legacy computing systems and as a compact way to represent binary data because three binary bits convert directly to one octal digit.

How do I convert decimal to octal?

Repeatedly divide the decimal number by 8, recording the remainder each time (0-7). Read the remainders from bottom to top. For example, 493 ÷ 8 = 61 remainder 5, 61 ÷ 8 = 7 remainder 5, 7 ÷ 8 = 0 remainder 7 → octal 755.

How do I convert octal to decimal?

Multiply each octal digit by 8 raised to its position (counting from 0 on the right), then sum the results. For example, octal 755 = (7 × 8² = 7 × 64 = 448) + (5 × 8¹ = 5 × 8 = 40) + (5 × 8⁰ = 5 × 1 = 5) = 493.

What is chmod 755?

chmod 755 is a Unix/Linux command that gives the file owner read, write, and execute permissions (7 = rwx) and gives the group and others read and execute permissions (5 = r-x). It is the standard permission setting for web directories.

What is the difference between 755 and 777?

755 gives full permissions to the owner (7 = read+write+execute) but only read+execute to group and others (5). 777 gives full permissions (read+write+execute) to everyone — owner, group, and others. 777 is generally considered a security risk on production servers.

What is chmod 644?

chmod 644 gives the owner read and write permissions (6 = rw-) and gives group and others read-only permissions (4 = r--). This is the standard permission setting for web files like HTML, CSS, and JavaScript.

Advertisement