Sumivo · Mathematics
Octal Calculator
Add, subtract, multiply and divide two octal numbers, with every result shown in both octal and decimal. Exact arithmetic on whole octal numbers.
01 / inputs
02 / result
A + B (OCT)
304
- A (decimal)
- 165
- B (decimal)
- 31
- Sum (A + B)
- 304₈ = 196
- Difference (A − B)
- 206₈ = 134
- Product (A × B)
- 11773₈ = 5115
- Quotient (A ÷ B)
- 5₈ r 12₈ = 5 r 10
Calculation trace
- 245₈ = 165₁₀Operand A to decimal
- 37₈ = 31₁₀Operand B to decimal
- 165 + 31 = 196 = 304₈Add
- 165 − 31 = 134 = 206₈Subtract
- 165 × 31 = 5115 = 11773₈Multiply
- 165 ÷ 31 = 5 remainder 10 = 5₈ r 12₈Divide (integer)
Maintained by Jack Shi
How it works
Each octal digit is a power of eight, so 245 in base 8 is 2×64 + 4×8 + 5×1 = 165 in base 10 (octal uses only the digits 0–7). The tool reads both operands that way, does the arithmetic on the whole numbers, and converts the answer back to octal. Addition, subtraction, and multiplication follow the ordinary rules on the decimal values; division is integer division, giving a whole-number quotient and a separate remainder (for example 245 ÷ 37 is 165 ÷ 31 = 5 remainder 10, shown as quotient 5 and remainder 12 in octal). All of this runs on exact big integers, so results stay precise no matter how large the numbers get, unlike ordinary floating-point which loses precision past 2^53.
Assumptions & limits
- Operands must contain only the octal digits 0–7 (an optional 0o prefix and leading zeros are allowed); anything else, including the digits 8 and 9, is rejected.
- Division is integer division: it returns a quotient and a remainder, not an octal fraction.
- A − B can be negative; it is shown with a minus sign rather than a two’s-complement pattern, because two’s complement needs a fixed bit width that a plain calculator does not assume.
- Inputs are capped at 43 octal digits each (about 128 bits) to keep the page responsive.
Verified runs
Synthetic examples executed at build revision be2e0e4 on . Cards round decimal results to 6 significant figures; matching uses full precision and the tolerance below. Matches cover the displayed fields, not every possible input or clinical or engineering validation.
Inputs: First operand: 245 octal integer; Second operand: 37 octal integer
Result: Octal sum: 304 (expected Octal sum: 304) ✓
Inputs: First operand: 77 octal integer; Second operand: 1 octal integer
Result: Octal sum: 100 (expected Octal sum: 100) ✓
Inputs: First operand: 0o017 octal integer; Second operand: 5 octal integer
Result: Octal sum: 24 (expected Octal sum: 24) ✓
How these runs were checked
Method: octal@1.0.0. Expectations come from the listed test fixtures or hand arithmetic; they are not copied from these executions. Omitted optional inputs use the method defaults. Run dates record execution, not expert review or fresh measurements.
Download all verified runs (JSON) — full inputs, returned values, expectations, timestamps and buildRevision.
- normal: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Octal sum: 304. Expected: Octal sum: 304. Expectation: packages/calculator-core/tests/octal.test.ts
- boundary: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Octal sum: 100. Expected: Octal sum: 100. Expectation: packages/calculator-core/tests/octal.test.ts
- sensitivity: . Absolute tolerance: 1e-10. Text and booleans match exactly. Full-precision result: Octal sum: 24. Expected: Octal sum: 24. Expectation: packages/calculator-core/tests/octal.test.ts
Reproduce from the source checkout with pnpm --filter @sumivo/web gen:verified-runs. A rebuild changes execution times; the revision identifies its Git starting point, including any uncommitted changes made for that build.
FAQ
- How do I add two octal numbers?
- Enter both numbers in octal and read the Sum row. For example 245 + 37 = 304, which is 165 + 31 = 196 in decimal. The tool shows every result in both octal and decimal.
- How does octal division work here?
- It is integer division. 245 ÷ 37 is 165 ÷ 31 = 5 with remainder 10, shown as quotient 5 and remainder 12 in octal. It does not produce an octal fraction.
- Why are the digits 8 and 9 rejected?
- Octal is base 8, so it uses only the digits 0 through 7. There is no single octal digit for eight or nine — eight is written 10 in octal — so an 8 or 9 in the input is not a valid octal number and is rejected.
- Is the result exact for very large octal numbers?
- Yes. The arithmetic uses arbitrary-precision integers, so a 64-bit or 128-bit operand is computed exactly — no rounding of the kind ordinary floating-point introduces beyond 2^53.
Related calculators
SOURCES
- OpenStax, Rice UniversityContemporary Mathematics — 4.3 Converting with Base Systems ↗
Base-8 (octal) positional notation and converting between base systems
Accessed 2026-09-22