Skip to content
Nikhilam Navatashcaramam Dashatah — Multiplication Near a Base (Vedic Math)

Nikhilam Navatashcaramam Dashatah — Multiplication Near a Base (Vedic Math)

DodaTech Updated Jun 7, 2026 9 min read

Nikhilam Navatashcaramam Dashatah (“All from 9 and last from 10”) is a Vedic sutra that multiplies numbers near powers of 10 — like 98×97, 103×105, or 998×997 — in 3–5 seconds mentally.

What you’ll learn: The Nikhilam sutra for rapid multiplication near a base.
Why it matters: This technique reduces multiplication to simple subtraction and one-digit multiplication — no long multiplication needed.
Real-world use: Competitive exam takers use it for near-base products. Programmers can implement it for fast integer multiplication in embedded systems.

The Sutra

Nikhilam Navatashcaramam Dashatah means “All from 9 and last from 10.” This describes how to find a number’s deficiency from a base (power of 10).

For two numbers close to a base (10, 100, 1000, etc.):

  1. Choose the nearest power of 10 as the base.
  2. Find each number’s deficiency from the base (using “all from 9 and last from 10”).
  3. Cross-subtract one deficiency from the other number — this gives the left part.
  4. Multiply the two deficiencies — this gives the right part.
  5. If the right part has fewer digits than the base has zeros, pad with leading zeros.

How the Method Works

    flowchart TD
    A["Numbers near a base<br/>e.g., 98 × 97"] --> B["Choose base = 100<br/>(nearest power of 10)"]
    B --> C["Find deficiencies<br/>98 is −2 from 100<br/>97 is −3 from 100"]
    C --> D{"Both numbers<br/>below base?"}
    D -- Yes --> E["Left: Cross-subtract<br/>98 − 3 = 95"]
    D -- No --> F["Left: Cross-add<br/>103 + 5 = 108"]
    E --> G["Right: Multiply deficiencies<br/>2 × 3 = 6"]
    F --> H["Right: Multiply excesses<br/>3 × 5 = 15"]
    G --> I["Pad right: 06<br/>(2 digits for base 100)"]
    H --> J["Pad right: 15<br/>(2 digits for base 100)"]
    I --> K["Combine: 9506 ✓"]
    J --> L["Combine: 10815 ✓"]

    style A fill:#1a73e8,color:#fff,stroke:none
    style B fill:#34a853,color:#fff,stroke:none
    style C fill:#fbbc04,color:#333,stroke:none
    style D fill:#ea4335,color:#fff,stroke:none
    style E fill:#ab47bc,color:#fff,stroke:none
    style F fill:#ab47bc,color:#fff,stroke:none
    style G fill:#46bdc6,color:#fff,stroke:none
    style H fill:#46bdc6,color:#fff,stroke:none
    style I fill:#1a73e8,color:#fff,stroke:none
    style J fill:#1a73e8,color:#fff,stroke:none
    style K fill:#34a853,color:#fff,stroke:none
    style L fill:#34a853,color:#fff,stroke:none
  

Finding Deficiencies with “All from 9 and Last from 10”

To find how far a number is from the base, use the sutra:

  • All digits from 9: subtract each digit from 9
  • Last digit from 10: subtract the last non-zero digit from 10

Example: 98’s deficiency from 100:

  • First digit: 9 − 9 = 0
  • Last digit: 10 − 8 = 2
  • Deficiency = 2

Example: 877’s deficiency from 1000:

  • 9 − 8 = 1, 9 − 7 = 2, 10 − 7 = 3
  • Deficiency = 123

Worked Examples

Example 1: 98 × 97 (Both numbers below base)

Base = 100

Step 1: Find deficiencies from 100.

  • 98 → 100 − 98 = 2 (using: 9−9=0, 10−8=2)
  • 97 → 100 − 97 = 3 (using: 9−9=0, 10−7=3)

Step 2: Cross-subtract to get the left part.

  • 98 − 3 = 95 (or 97 − 2 = 95 — same result)

Step 3: Multiply deficiencies for the right part.

  • 2 × 3 = 6

Step 4: Since base 100 needs 2 digits on the right, pad: 06.

Answer: 9506

Example 2: 103 × 105 (Both numbers above base)

Base = 100

Step 1: Find excesses above 100.

  • 103 → +3
  • 105 → +5

Step 2: Cross-add to get the left part.

  • 103 + 5 = 108 (or 105 + 3 = 108)

Step 3: Multiply excesses for the right part.

  • 3 × 5 = 15

Step 4: Base 100 needs 2 digits: 15 is fine.

Answer: 10815

Example 3: 998 × 997 (Both below base)

Base = 1000

Step 1: Deficiencies from 1000.

  • 998 → 2
  • 997 → 3

Step 2: Cross-subtract: 998 − 3 = 995

Step 3: Multiply deficiencies: 2 × 3 = 6

Step 4: Base 1000 needs 3 digits on the right: pad to 006.

Answer: 995006

Example 4: 1004 × 1007 (Both above base)

Base = 1000

Step 1: Excesses above 1000.

  • 1004 → +4
  • 1007 → +7

Step 2: Cross-add: 1004 + 7 = 1011

Step 3: Multiply excesses: 4 × 7 = 28

Step 4: Base 1000 needs 3 digits: 028.

Answer: 1011028

Example 5: 9995 × 9997 (Large numbers below base)

Base = 10000

Step 1: Deficiencies from 10000.

  • 9995 → 5
  • 9997 → 3

Step 2: Cross-subtract: 9995 − 3 = 9992

Step 3: Multiply deficiencies: 5 × 3 = 15

Step 4: Base 10000 needs 4 digits: pad to 0015.

Answer: 99920015

Code Snippet: Python Implementation

def nikhilam_multiply(a, b):
    """
    Multiply two numbers near a power-of-10 base using Nikhilam.
    Works for numbers both below, both above, or straddling the base.
    """
    # Determine the base — nearest power of 10 above the larger number
    base = 10 ** len(str(max(a, b)))

    # Deficiencies from base
    def deficiency(n):
        """Find how far n is from base using 'all from 9, last from 10'."""
        diff = base - n
        if diff >= 0:
            return diff, False  # below base
        else:
            return abs(diff), True  # above base

    def_a, above_a = deficiency(a)
    def_b, above_b = deficiency(b)

    if above_a == above_b:
        # Both on same side of base
        left = a + (def_b if above_b else -def_b)
        right = def_a * def_b
    else:
        # One above, one below — use cross-subtraction
        left = a - (def_b if above_b else -def_b)
        right = -(def_a * def_b) if above_a else -(def_a * def_b)

    # Right part must have as many digits as base has zeros
    num_zeros = len(str(base)) - 1
    right_str = str(abs(right)).zfill(num_zeros)

    combined = str(left) + right_str
    if right < 0:
        combined = str(left - 1) + str(10**num_zeros + right)

    return int(combined)

# Test
tests = [(98, 97), (103, 105), (998, 997), (1004, 1007), (9995, 9997)]
for a, b in tests:
    result = nikhilam_multiply(a, b)
    print(f"{a} × {b} = {result} (expected: {a*b})")

Expected output:

98 × 97 = 9506 (expected: 9506)
103 × 105 = 10815 (expected: 10815)
998 × 997 = 995006 (expected: 995006)
1004 × 1007 = 1011028 (expected: 1011028)
9995 × 9997 = 99920015 (expected: 99920015)

Code Snippet: JavaScript Implementation

function nikhilamMultiply(a, b) {
    const base = Math.pow(10, String(Math.max(a, b)).length);

    const defA = base - a;
    const defB = base - b;
    const aboveA = defA < 0;
    const aboveB = defB < 0;

    const absDefA = Math.abs(defA);
    const absDefB = Math.abs(defB);

    let left, right;
    if (aboveA === aboveB) {
        left = aboveA ? a + absDefB : a - absDefB;
        right = absDefA * absDefB;
    } else {
        left = a + (aboveB ? absDefB : -absDefB);
        right = -(absDefA * absDefB);
    }

    const numZeros = String(base).length - 1;
    const rightStr = String(Math.abs(right)).padStart(numZeros, '0');

    if (right < 0) {
        return parseInt(String(left - 1) + String(Math.pow(10, numZeros) + right));
    }
    return parseInt(String(left) + rightStr);
}

// Test
const tests = [[98, 97], [103, 105], [998, 997], [1004, 1007], [9995, 9997]];
tests.forEach(([a, b]) => {
    console.log(`${a} × ${b} = ${nikhilamMultiply(a, b)} (expected: ${a * b})`);
});

Common Errors

  1. Picking the wrong base. Always use the nearest power of 10 (10, 100, 1000…) above the larger number. For 21 × 19, base = 100, not 10.
  2. Incorrect deficiency calculation. Always use “all from 9, last from 10” — each digit from 9, last non-zero digit from 10. 104 → 9−1=8? No, 104 is above 100, so deficiency is −4, not 896.
  3. Forgetting to pad the right side. Base 100 requires 2 digits on the right (06, not 6). Base 1000 requires 3 digits. Missing zeros gives wildly wrong answers.
  4. Using Nikhilam for numbers far from the base. 67 × 42 is near 100, but deficiencies are 33 and 58 — their product is 1914, which is 4 digits. The method fails. Use Urdhva Tiryagbhyam instead.
  5. Sign errors with one-below-one-above cases. 102 × 97: 102 is +2, 97 is −3. Cross-subtract: 102 − 3 = 99. Multiply: 2 × (−3) = −6. Right: 100 − 6 = 94. Answer: 9894.
  6. Applying to non-integers without adjustment. For 9.8 × 9.7, work with 98 × 97 = 9506, then place decimal: 95.06 (2 decimal places).
  7. Confusing Nikhilam with Ekadhikena. Nikhilam is for near-base multiplication; Ekadhikena is for squaring numbers ending in 5. Different sutras, different patterns.

Practice Questions

  1. 96 × 93 = ?
  2. 104 × 102 = ?
  3. 9998 × 9995 = ?
  4. 10005 × 10002 = ?
  5. 97 × 105 = ? (one below, one above base)

Answers:

  1. 96 × 93 = 8928 (96−7=89, 4×7=28 → 8928)
  2. 104 × 102 = 10608 (104+2=106, 4×2=08 → 10608)
  3. 9998 × 9995 = 99930010 (9998−5=9993, 2×5=10 → 99930010, pad 0010)
  4. 10005 × 10002 = 100070010 (10005+2=10007, 5×2=10 → pad 010 → 100070010)
  5. 97 × 105 = 10185 (97+5=102, (−3)×5=−15, 102−1=101, 100−15=85 → 10185)

Mini Project: Base Multiplier with Validation

Build a program that:

  1. Asks the user for two numbers
  2. Detects the nearest power-of-10 base
  3. Checks if both numbers are within 10% of that base (otherwise warns the user)
  4. Computes the product using Nikhilam and compares with standard multiplication
def nikhilam_check(a, b):
    base = 10 ** len(str(max(a, b)))
    threshold = base * 0.1

    def_a = abs(base - a)
    def_b = abs(base - b)

    if def_a > threshold or def_b > threshold:
        print(f"Warning: Numbers are far from base {base}.")
        print("Result may be inaccurate. Consider using Urdhva Tiryagbhyam.")

    result = nikhilam_multiply(a, b)
    expected = a * b
    print(f"Nikhilam: {a} × {b} = {result}")
    print(f"Standard: {a} × {b} = {expected}")
    print(f"Match: {result == expected}")

# Test
nikhilam_check(98, 97)   # Good — both near 100
nikhilam_check(67, 42)   # Warning — far from base 100

FAQ

What does Nikhilam Navatashcaramam Dashatah mean?
It means “All from 9 and last from 10.” This describes the method for finding a number’s deficiency from a power-of-10 base: subtract each digit from 9, and the last digit from 10.
Can I use Nikhilam for any two numbers?
Technically yes, but it’s most efficient when both numbers are near the same power of 10. For numbers far from the base, the right-part multiplication becomes large, defeating the purpose.
What about numbers straddling the base, like 102 × 97?
Treat 102 as +2 and 97 as −3. Cross-subtract: 102 − 3 = 99 (left part). Multiply: 2 × (−3) = −6. Right part: 100 − 6 = 94. Answer: 9894.
How is this useful in programming?
Nikhilam multiplication maps to bit-shift operations. In embedded systems without hardware multipliers, this technique reduces multiplication to shifts and adds, which is significantly faster.

Next Steps

After mastering Nikhilam, learn Urdhva Tiryagbhyam — Vertically and Crosswise Multiplication for multiplying any numbers, not just those near a base.

Related tutorials:

  • Ekadhikena Purvena — squaring numbers ending in 5
  • Digital Roots — verify your Nikhilam products
  • JavaScript — front-end implementation of Vedic multipliers

Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro