About the Octal to Decimal Converter
Octal numbers appear in Unix file permissions, some older computing systems and number-system homework. This octal to decimal converter changes an octal number into decimal exactly, at any length, and shows how each digit's place value contributes: the permission value 755 in octal equals 493 in decimal. Binary and hexadecimal results are shown alongside for comparison.
The converter uses place values: each octal digit is multiplied by 8 raised to its position, counting from 0 on the right, and the results are added. Each digit's contribution is listed in the working section. Examples: 17 in octal is 15 in decimal; 644 in octal is 420 in decimal; 755 in octal is 493 in decimal.
Octal survives mainly in Unix and Linux file permissions, where each digit packs the read (4), write (2) and execute (1) bits for the owner, group and others: 755 means rwxr-xr-x. It also appears in older computing documentation, some aviation transponder codes and C and Python number literals that start with 0 or 0o. Converting octal to decimal gives the plain value of such a number.
Other bases are covered by the number base converter, which converts between any bases from 2 to 36. For arithmetic in these bases, use the binary calculator or the hex calculator; to turn text into its binary character codes, use text to binary.
How to use the Octal to Decimal Converter
- Enter the octal numberType or paste the number. Digits 0 to 7. A 0o prefix is fine.
- Read the decimal resultThe decimal value appears instantly, along with the binary and hexadecimal equivalents.
- Follow the workingOpen the step-by-step section to see how the conversion was done, digit by digit or division by division.
- Copy or shareCopy all results with one click, or copy a link that reopens the converter with the same number.
Octal to Decimal Converter features
- Exact conversion of numbers of any length using BigInt arithmetic
- Step-by-step working for homework and exam practice
- Binary and Hexadecimal results shown alongside
- Negative numbers with 8- to 128-bit two's complement forms
- Optional digit grouping (4 bits, 2 hex digits or thousands) for easy reading
- Accepts prefixes such as 0x, 0b and 0o and ignores spaces and underscores
- Runs in your browser with nothing sent to a server
Common uses
- Checking computer science and digital electronics homework
- Reading values from datasheets, debuggers and log files
- Working out color codes, permissions and bit masks
- Converting values for programming and scripting
- Learning how positional number systems work
Octal to decimal in practice: permissions that go wrong in scripts, leading zeros in code, transponder codes and escape sequences
Octal is rare outside a few niches, but where it appears, mixing it up with decimal causes real bugs. This guide shows how a permission written in a configuration file can silently become something else, explains leading zeros in programming languages, and covers aircraft transponder codes, octal escape sequences in strings and converting through binary.
A worked example: a permission that goes wrong
An automation script sets a file's mode with the value 644, intending read and write for the owner and read for everyone else. If the tool reads that value as a decimal number, 644 in decimal is 1204 in octal, which sets the sticky bit, gives the owner write but not read access and gives group members nothing. Configuration management tools such as Ansible warn about exactly this and ask for modes written as quoted strings or with a leading zero, such as '0644'.
Reading modes reported in decimal
Programs and APIs sometimes report permissions as decimal numbers. A mode of 420 converts to octal 644, and 493 converts to 755. If a file listing tool shows 33188, converting it to octal gives 100644, where the leading digits mark a regular file and 644 are the familiar permission bits.
Leading zeros in code
In C and older JavaScript, a number written with a leading zero, such as 010, is octal and equals 8. Python 3 requires the explicit prefix 0o for octal and rejects plain leading zeros, and modern JavaScript disallows legacy octal numbers in strict mode. Zero-padded values typed into code, such as dates or codes, are a classic source of confusing bugs.
Transponder codes
Aircraft transponders use four-digit codes made only of the digits 0 to 7, which makes them octal numbers with 4,096 possible combinations. A few codes have special meanings recognised worldwide: 7700 signals a general emergency, 7600 a radio failure and 7500 unlawful interference.
Escape sequences
In C, Python and several other languages, a backslash followed by octal digits inside a string inserts the character with that code. The sequence \101 is octal 101, which is 65 in decimal, the letter A. Such escapes appear in older code and data files, and converting them reveals the characters intended.
Converting through binary
Each octal digit is exactly three bits, so octal converts to binary by replacing each digit with its three-bit pattern, and from there to decimal or hex. For 755, the bits are 111 101 101, which is 493 in decimal and 1ED in hex. Going through binary makes relationships between the bases easy to see.
Exam working
Multiply each digit by the matching power of 8, counting from 0 at the right, and add. For 17 that is 1 × 8 + 7 = 15, and for 644 it is 6 × 64 + 4 × 8 + 4 = 420. Remember that the digits 8 and 9 never appear in octal, so a number containing them is not octal.
umask values
The umask, which sets default permissions for new files, is also written in octal. A umask of 022, which is 18 in decimal, removes write permission for group and others, so new files are created as 644 and new folders as 755. Recognising the octal form avoids confusion when the value appears in decimal in a program's output.
Reading older documentation
Documentation for older computers and some file formats uses octal throughout, because early machines grouped bits in threes. Converting values to decimal or hex as you read makes such material much easier to compare with modern references.
Common mistakes
- Passing permission values to tools that read them as decimal.
- Writing numbers with leading zeros in code.
- Including the digits 8 or 9 in octal values.
- Forgetting the 0o prefix in Python.
Related tools
To convert in the other direction, use Decimal to Octal Converter. To translate permissions into plain language, try Chmod Calculator, and for other bases, Number Base Converter.
Octal in spreadsheets
Excel and Google Sheets provide OCT2DEC and DEC2OCT for converting whole columns, which helps when auditing permission values exported from servers. The results can then be compared with expected modes using ordinary formulas.
Special permission digits
Permission modes can have a fourth, leading digit for special bits, such as 4755 for a program that runs with its owner's rights or 1777 for shared temporary folders. In decimal these are 2541 and 1023. When such numbers appear in logs, converting them back to octal reveals the special bits immediately.
Why programs print decimal
Most programming languages print numbers in decimal by default, which is why permissions often appear as 420 or 493 in debug output. Printing with Python's oct function or JavaScript's toString with a base of 8 shows the familiar octal form directly.
Checking a permission quickly
To check a mode such as 750 without a calculator, take each digit separately: 7 is read, write and execute, 5 is read and execute, and 0 is nothing. Converting the whole number to decimal is rarely needed for permissions; reading the digits one at a time is faster and less error-prone.
Privacy
Conversions run in your browser. Nothing you enter is sent anywhere or stored.
Frequently asked questions
What does chmod 755 mean in decimal?
755 in octal is 493 in decimal (7 × 64 + 5 × 8 + 5), but permissions are read digit by digit rather than as one number: 7 (rwx) for the owner, 5 (r-x) for the group and 5 (r-x) for everyone else. The binary result shows the nine permission bits directly.
What is the largest number this converter can handle?
It accepts up to 400 digits, far beyond the 64-bit limit of 18446744073709551615 (2^64 − 1). The calculation uses arbitrary-precision integers, so even very long numbers convert exactly without rounding.
Can I convert negative numbers?
Yes. Put a minus sign in front and the result keeps the sign, for example -17 in octal is -15 in decimal. For binary work, the details section also shows the two's complement form that computers use to store negative integers.
Does it convert fractions or decimal points?
No. The converter works with whole numbers, which is what bases are used for in computing. Fractional values such as 0.1 often have infinitely repeating forms in binary, so they need a separate floating-point tool.
Why are the digits grouped?
Grouping makes long numbers easier to read and check: binary is split into blocks of 4 bits (one hex digit each), hex into pairs (one byte each) and decimal into thousands. Untick the grouping option to get one continuous string for copying into code.
Where is octal still used?
Mainly in Unix and Linux file permissions (chmod 644, 755), in some older computer documentation and in number literals in programming languages, where a leading 0o or 0 marks an octal value. Each octal digit stands for exactly three bits.