Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Developer tools

Octal calculator

Type two base 8 numbers into this octal calculator and choose an operation. 754 plus 67 is 1043 in octal, which is 492 + 55 = 547 in decimal. The page writes out the carries, shows the answer in decimal, binary and hex, and lists all four operations side by side.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Use only the digits 0 to 7. A leading minus, 0o, spaces and low lines (_) are fine.
754 + 67 (base 8)

1043547 in decimal

  • 492 + 55
  • 0x223
  • 4 octal digits
Decimal
547
Binary
1 000 100 011
Hex
0x223
Octal digits
4
Working
carry  111 
A       754
+        67
       ----
result 1043
All four operations on A and B
OperationOctalDecimal
Add (A + B)1043547
Subtract (A - B)665437
Multiply (A × B)6466427,060
Divide (A ÷ B)10 remainder 648 remainder 52

How to use the Octal Calculator

  1. Enter Octal number A and Octal number B with the digits 0 to 7.
  2. Pick the Operation from the list: add, subtract, multiply or divide.
  3. Read the octal answer first. Under it sit the decimal, binary and hex values, and the working for sums and differences.
  4. Tap Swap A and B to reverse the order, or Copy the result to take the octal answer with you.

How do you add octal numbers?

Octal is base 8, so a column holds the digits 0 to 7 and rolls over at 8 instead of 10. Add the digits of a column and the carry from the right. If the total is 8 or more, write the total minus 8 and carry 1 to the next column. A total of 11 in a column is written as 3 with a carry of 1, because 11 − 8 = 3.

For 754 plus 67, the right column is 4 + 7 = 11, written 3 carry 1. The middle column is 5 + 6 + 1 = 12, written 4 carry 1. In the left column 7 + 0 + 1 = 8, so you write 0, carry 1, and that last carry turns into the first digit. The sum is 1043. The page prints this working under the answer, with each carry written over the column it enters.

A decimal check agrees: 492 + 55 = 547, and 547 written in base 8 is 1043.

How do subtraction, multiplication and division work in base 8?

Subtraction borrows the way it does in base 10, except that a borrowed 1 is worth 8. 754 minus 67 is 665, which is 437 in decimal. Taking a bigger number from a smaller one flips the sign: 17 minus 20 is -1, and the column working switches to larger minus smaller, with the minus sign added at the end.

Multiplication uses the base 8 times table, where 7 × 7 is 61 because 49 = 6 × 8 + 1. The product of 754 and 67 is 64664, or 27060 in decimal. Division returns a whole quotient and a remainder: 492 divided by 55 is 10 with remainder 64. The page checks it by multiplying back, so the quotient times the divisor plus the remainder must equal A.

The quotient is cut toward zero and the remainder keeps the sign of A. A number such as −17 divided by 4 gives -3 with remainder -3. Dividing by zero shows a message instead of an answer.

All four operations on 754 and 67
OperationOctalDecimal
Add (A + B)1043547
Subtract (A - B)665437
Multiply (A × B)6466427,060
Divide (A ÷ B)10 remainder 648 remainder 52

Why does octal match three binary digits?

Eight is 2 cubed, so one octal digit stands for exactly three bits. Split a binary number into groups of three from the right and each group is one octal digit. The sum 1043 is 1 000 100 011 in binary: the groups 1, 000, 100 and 011 read as 1, 0, 4 and 3. The same value is 0x223 in hex, where the grouping is by four bits instead.

That tidy fit is why octal turned up in early computers with word sizes that were multiples of three bits, and why it is still used for Unix file modes. In a mode such as 755, each digit is a sum of read (4), write (2) and execute (1), and the three digits are the owner, the group and everyone else, according to the POSIX description of chmod. The table lists the seven digits that appear.

One octal digit as three bits and as permissions
DigitThree bitsRead, write, execute
0000---
1001--x
2010-w-
4100r--
5101r-x
6110rw-
7111rwx

How long can the octal numbers be, and how do I read a file mode?

Each number may have up to 256 octal digits. All arithmetic uses whole numbers with no size cap, so there is no rounding and no overflow. Multiplying 22 sevens by 7 gives 67 777 777 777 777 777 777 771, and the page shows every digit. A number can start with a minus sign or 0o, and spaces or low lines may group the digits, so 7_5_5 is read as 755. The column working appears for add and subtract on numbers of up to 40 digits.

When the answer lies between 0 and 777 the page also prints it as a file mode. Adding 644 and 111 gives 755, which reads as rwxr-xr-x: the owner may read, write and execute, and the group and others may read and execute. For a base change without arithmetic use the number base converter, for the same sums in base 2 the binary calculator, and for bit operations the bitwise calculator.

Use it with

  • Binary Calculator: binary calculator for adding, subtracting, multiplying and dividing binary numbers of any length, with carries shown, decimal and hex answers.
  • Number Base Converter: binary, octal, decimal, hex.
  • ASCII to Hex Converter: convert ASCII text to hex codes with a byte table, control character names and five output styles. Accents and emoji become UTF-8 bytes.

Questions

What digits does octal use?

Octal uses only 0 to 7. The digits 8 and 9 do not exist in base 8, so the page names them in an error message if you type one.

What is 7 + 1 in octal?

It is 10, because 7 + 1 = 8 and 8 is one group of eight and nothing left over. In decimal the answer is 8.

What is 754 + 67 in octal?

The sum is 1043. In decimal that is 492 + 55 = 547.

Can I use negative numbers?

Yes. Start a number with a minus sign. For example 17 minus 20 gives -1. A plain leading minus marks the sign, and no complement form is used.

How do I turn the answer into decimal?

The decimal line sits under the answer. Each octal place is worth 8 times the one on its right, so 1043 is 1 × 512 + 0 × 64 + 4 × 8 + 3 = 547.

Does it work with chmod modes?

For answers from 0 to 777 the page shows the permission letters. Adding 644 and 111 gives 755, which is rwxr-xr-x.

The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.