HomeCalculatorsMathBasic ArithmeticSubtraction Calculator
Math calculator

Subtraction Calculator

Solve a missing subtraction term or see exact decimal long subtraction with borrowing. Compare modes, check input limits, and share or export complete results.

Instant result
Result
—

Enter values to calculate.

Inputs—
Mode—
Formula—
Trust summary CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance
Input interpretation
Enter values to calculate.
Result
—
Assurance
Core
Declared partition coverage
PASS · 6/6 declared partitions (difference, solve-for-minuend, solve-for-subtrahend, long-normal, long-negative-result, invalid-domain) · Matrix
Numerical scope
82 independent complete packs across binary64 missing-term and exact bounded decimal Long branches; no exhaustive-domain proof.
Known limitations
  • Declared partitions are difference, solve-for-minuend, solve-for-subtrahend, long-normal, long-negative-result, invalid-domain — aligned with published capability modes. CPython independently checks full packs, exact scaled-integer differences and column borrowing, including negative-result sign.
  • Core CVP does not include live graph, viewport, or pointer interaction.
Model
Difference of two numbers, optional solve-for-missing-term, and long subtraction with regrouping steps.
Scope
Difference mode: binary64 arithmetic; exactly two terms; scientific notation allowed; integral inputs within ±(2^53−1).
Verification
Engine tested · Source checked · v1.0.2 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance· View Manifest · CVP overview · Specification
Versions
Calculation 1.0.2 · CVP protocol 1.0.0-proposed · Evidence 2026-10-22.subtraction-complete-contract-v3
Verification revision
2026-10-22.subtraction-complete-contract-v3 · 2/2 property · digest a0f1f4f1c566
Legacy regression
7/7 tests · Production surface contract 6/6
Trust layers
Verification VERIFIED · Production CURRENT · Overall CVP state: VERIFIED under CVP 1.0.0-proposed
Reference
O1 model · O2 expected_values · O2 numerical_behavior
Interfaces
PASS · UI (SSR) / REST / MCP — ui-ssr is query-result HTML, not a live browser session. Error-path engine·REST·MCP 1/1 (status, code, calculation_version). SSR compared on URL-canonical requested calculations; empty query is idle (not an error) and JSON-typed object/array inputs are REST/MCP-only.
Supplemental domain review
Not performed
Named expert review
Not performed
CVP suite
82/82 golden · 1/1 CVP boundary · 5/5 invalid · 2/2 property · 1/1 metamorphic · 2/2 round-trip · 7/7 cross-interface · 6/6 CVP contract · Manifest
Sources
Sources
Evidence
6 legacy golden · 1 legacy boundary · legacy regression suite · 82/82 oracle-backed golden · 5/5 invalid · Artifact integrity PASS
This calculator CURRENT · Public schema 1.0.2 matches · Semantic contract ✓ · Production attested · Public/cache ✓ · Origin ✓
Semantic contract
PASS
Full verification

Manifest identity, reference classes, interfaces, suite, and production records.

Formulas

Core equations used by this calculator.

DifferenceMinuend − Subtrahend = Difference
As additiona − b = a + (−b)
InverseIf a + b = c then c − a = b and c − b = a
iLong subtraction mode shows column work with regrouping (borrowing) for non-negative numbers. Difference mode accepts decimals, negatives, and can solve for any one blank field.

How to use

1

Choose Difference or Long subtraction

Difference solves a − b (any two of three fields). Long mode shows borrowing steps.

2

Enter the numbers

Minuend on top / first; subtrahend second. Decimals and negatives work in Difference mode.

3

Read the difference

Long mode prints aligned columns and each regrouping step under the form.

Example calculations

Common configurations with formula and result.

ϟ

Simple

8 − 3

minuend − subtrahend
5
ϟ

With regrouping

245 − 147

long subtraction
98
ϟ

Decimals

2.30 − 1.12

align decimal points
1.18
ϟ

Minus a negative

4 − (−3)

4 + 3
7
ϟ

Solve for minuend

? − 6 = 9

minuend = difference + subtrahend
15

Quick checks

Common values at a glance.

ProblemDifference
8 − 35
245 − 14798
15 − 69
2.30 − 1.121.18
4 − (−3)7
−4 − 3−7
i 245 − 147 needs regrouping in the ones and tens columns (result 98).

Subtraction calculator specification

Version 1.0.2 · Engine tested

Calculation status

Review policy · Evidence

Definition
Subtraction takes the subtrahend away from the minuend. The result is the difference: Minuend − Subtrahend = Difference. It is the inverse of addition and is neither commutative nor associative.
What it calculates
Difference of two numbers, optional solve-for-missing-term, and long subtraction with regrouping steps.
Inputs
  • Minuend and subtrahend (or any two of minuend, subtrahend, difference)
  • Mode: Difference or Long subtraction
Outputs
  • Difference (and solved missing term when applicable)
  • Column work with borrowing (Long subtraction)
Formula
Minuend − Subtrahend = Difference
Assumptions
  • Difference mode: binary64 arithmetic; exactly two terms; scientific notation allowed; integral inputs within ±(2^53−1).
  • Long subtraction: non-negative decimal numbers without scientific notation.
  • Order is minuend − subtrahend. When minuend < subtrahend the difference is negative; long mode still stacks the minuend on top. Column work subtracts the smaller magnitude from the larger, then applies the sign.
Units
  • Numeric only. If the values represent quantities, use the same unit for both inputs; the difference has that same unit.
Boundary conditions
  • Exactly one blank among three fields when solving for a missing term
  • Long mode rejects negatives and scientific notation
  • Long mode does not require minuend ≥ subtrahend (45 − 123 = −78)
Example
245 − 147 = 98
Validation cases

6 published on this page · 7/7 tests · Production surface contract 6/6 · View evidence

  • 8 − 3 → 5
  • 245 − 147 → 98
  • 2.30 − 1.12 → 1.18
  • 4 − (−3) → 7
  • ? − 6 = 9 → 15
  • 45 − 123 (long) → −78
Sources
  • CalculatorX mathematical conventions — Long subtraction with regrouping
    Supports: Column subtraction with borrowing; negative differences keep the minuend on top.
  • Margaret Stevens — The Maths Workbook (University of Oxford) — Chapter 1, §1: Algebraic Expressions and Fractions; §3: Equations
    Supports: Algebraic addition/subtraction, multiplication/division, distributive rules, equivalent fractions, common denominators and reciprocals. Ratios are interpreted as quotients. Equality of ratios with nonzero denominators permits cross multiplication, and solving a proportion uses the chapter’s equation transformations. A zero divisor is excluded; integer quotient/remainder uses the separately cited Euclidean-division reference. Mathematical reference only; not implementation validation or an endorsement of CalculatorX.
Calculation version
1.0.2

Background

Interpretation and common distinctions.

What does this subtraction calculator compute?

Subtraction takes the subtrahend away from the minuend. The result is the difference: Minuend − Subtrahend = Difference. It is the inverse of addition and is neither commutative nor associative.

The published formula or method is Minuend − Subtrahend = Difference. The following references support the stated mathematics or method:

  • Margaret Stevens — The Maths Workbook (University of Oxford): Algebraic addition/subtraction, multiplication/division, distributive rules, equivalent fractions, common denominators and reciprocals. Ratios are interpreted as quotients. Equality of ratios with nonzero denominators permits cross multiplication, and solving a proportion uses the chapter’s equation transformations. A zero divisor is excluded; integer quotient/remainder uses the separately cited Euclidean-division reference. Mathematical reference only; not implementation validation or an endorsement of CalculatorX.

Which inputs and limits should you check?

Follow the input domain, units, branch or solve direction, and rounding policy in the specification. Preserve exact outputs and any additional candidates or warnings.

The worked example uses 8 − 3 with minuend − subtrahend. Compare it with the Example calculations and the complete result for the same inputs.

How can you verify and cite this result?

CalculatorX is responsible for this page. The mathematical references above explain the model; implementation checks and their scope are documented separately in the math.subtraction v1.0.1 Evidence and capability contract. Read the displayed verification and production state together with the specification's numerical limits.

Use the clean calculator URL to cite the tool. A shared input link identifies a particular calculation. Content updates, numerical verification, and domain reviews have separate dates and scopes.

What is subtraction?

Subtraction is taking one quantity (the subtrahend) away from another (the minuend). The result is the difference:

Minuend − Subtrahend = Difference

It is the inverse of addition: if a + b = c, then c − a = b and c − b = a. Subtracting b is the same as adding −b:

a − b = a + (−b)

Properties

Property Subtraction
Commutative? No — a − b ≠ b − a in general
Associative? No — (a − b) − c ≠ a − (b − c) in general
Inverse of Addition

Long subtraction with regrouping

  1. Stack the minuend on top and the subtrahend below; align place values and decimal points.
  2. Subtract each column right → left.
  3. If the top digit is smaller than the bottom, borrow 1 from the left (that digit − 1) and add 10 to the current top digit.
  4. Continue until every column is done.
  5. If the minuend is smaller than the subtrahend, the result is negative. For the column work, subtract the smaller magnitude from the larger magnitude, then apply the negative sign.

Example: 245 − 147 = 98 (ones and tens both need regrouping). When minuend < subtrahend: 45 − 123 = −(123 − 45) = −78. Display still stacks the original minuend on top.

Precision and machine contract

Difference uses IEEE-754 binary64, including decimal-to-binary conversion. Its shortest round-trip display preserves the computed value; it is not exact decimal arithmetic. All normalized integral operands must lie within ±(2^53−1). Subtracting nearly equal inputs can amplify relative input or conversion error; measurement uncertainty is not modeled. Provide exactly two terms: three filled terms are rejected rather than silently replacing the supplied difference. Nonzero textual underflow is rejected as NUMERIC_UNDERFLOW; nonzero subnormal values are accepted.

Long mode accepts non-negative plain decimals and uses exact digit arithmetic with borrowing. At most 48 aligned columns are allowed, counting the greatest integer width plus the greatest fractional width after redundant zeros are removed. display and exact_value contain the exact decimal result; JSON numeric fields are approximate conveniences. Send large operands as strings. Long mode requires minuend and subtrahend, with difference blank or omitted. For 999999999999999999999999 − 1, the exact result is 999999999999999999999998.

Each token is limited to 512 characters. Grouping commas, hexadecimal text, invalid types/modes, unknown keys and conflicting aliases are rejected. Canonical names are minuend, subtrahend, difference; supported aliases are minInput/a, subInput/b, diffInput/d. Missing mode means Difference; diff and sub alias Difference. Blank fields stay blank when shared, cleared or reloaded. Shared links execute the current engine and do not preserve historical runtimes.

Typing calculates locally. Shared query URLs and REST/MCP calls send inputs to the server; URLs may appear in logs or browser history. Recent calculations may persist in local browser storage and can be cleared using History. CSV and copied JSON include the full output and work. Invalid inputs disable result export.

Frequently asked questions

Key distinctions behind the calculation.

What is subtraction?

Taking the subtrahend away from the minuend. The result is called the difference: Minuend − Subtrahend = Difference.

What are minuend and subtrahend?

The minuend is the starting number (first). The subtrahend is the amount taken away (second). In 8 − 3, 8 is the minuend and 3 is the subtrahend.

Is subtraction commutative?

No. Order matters: 10 − 3 = 7, but 3 − 10 = −7.

Is subtraction associative?

No. For example (10 − 3) − 1 = 6, while 10 − (3 − 1) = 8.

How do I subtract a negative number?

Subtracting a negative is the same as adding its opposite: a − (−b) = a + b. Example: 4 − (−3) = 7.

What is regrouping (borrowing)?

When a top digit is smaller than the bottom digit in a column, borrow 1 from the next higher place (that digit decreases by 1) and add 10 to the current top digit, then subtract.

How do I subtract decimals?

Align decimal points, pad with zeros so both have the same number of fractional digits, subtract as integers, then put the decimal back in the same place.