Urdhva Tiryagbhyam — Vertically and Crosswise Multiplication (Vedic Math)
In this tutorial, you'll learn about Urdhva Tiryagbhyam. We cover key concepts, practical examples, and best practices.
Urdhva Tiryagbhyam ("Vertically and crosswise") is the most powerful Vedic multiplication sutra — it works for all numbers, not just special cases. It reduces multi-digit multiplication to a single-line mental calculation.
What you'll learn: The Urdhva Tiryagbhyam sutra for multiplying any two numbers using vertical and crosswise patterns.
Why it matters: This is the most general and widely applicable Vedic multiplication technique — no special conditions needed.
Real-world use: It's so efficient that hardware implementations (like DSP chips) use Urdhva-Tiryagbhyam-based multipliers for digital signal processing.
The Sutra
Urdhva Tiryagbhyam means "Vertically and crosswise." The method generates partial products by combining digits in a cross-pattern, then sums them with carries.
2-Digit × 2-Digit Pattern
For multiplying AB × CD (two 2-digit numbers):
A B
× ×
C D
The three partial products are:
- Vertical: B × D (rightmost column) — gives the units digit (and carry)
- Crosswise: A×D + B×C (middle cross) — gives the tens digit (and carry)
- Vertical: A × C (leftmost column) — gives the remaining digits
flowchart TD
A["Two 2-digit numbers
AB × CD"] --> B["Step 1: Vertical (B × D)
Units digit with carry"]
B --> C["Step 2: Crosswise (A×D + B×C)
Tens digit with carry"]
C --> D["Step 3: Vertical (A × C)
Remaining digits"]
D --> E["Combine all parts
with carries"]
E --> F["Final product ✓"]
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:#1a73e8,color:#fff,stroke:none
Worked Examples
Example 1: 23 × 14 (2-digit × 2-digit)
2 3
× ×
1 4
Step 1 — Vertical (right): 3 × 4 = 12
- Units digit: 2, carry 1
Step 2 — Crosswise: (2×4) + (3×1) = 8 + 3 = 11
- Plus carry 1: 11 + 1 = 12
- Tens digit: 2, carry 1
Step 3 — Vertical (left): 2 × 1 = 2
- Plus carry 1: 2 + 1 = 3
Answer: Combine: 3 | 2 | 2 = 322
Check: 23 × 14 = 322 ✓
Example 2: 87 × 93 (2-digit × 2-digit)
8 7
× ×
9 3
Step 1: 7 × 3 = 21 → digit 1, carry 2
Step 2: (8×3) + (7×9) = 24 + 63 = 87 + carry 2 = 89 → digit 9, carry 8
Step 3: 8 × 9 = 72 + carry 8 = 80
Answer: 8091
Check: 87 × 93 = 8091 ✓
Example 3: 312 × 214 (3-digit × 3-digit)
For 3-digit numbers, the pattern extends naturally:
3 1 2
× × ×
2 1 4
Step 1 — Vertical (right): 2 × 4 = 8 → digit 8, carry 0
Step 2 — Crosswise (last two): (1×4) + (2×1) = 4 + 2 = 6 → digit 6, carry 0
Step 3 — Crosswise (outer + inner): (3×4) + (2×2) + (1×1) = 12 + 4 + 1 = 17 → digit 7, carry 1
Wait — let me show this properly. For 3-digit, the pattern is:
a b c
× × ×
d e f
The partial products (right to left):
- c × f
- b×f + c×e
- a×f + b×e + c×d
- a×e + b×d
- a×d
Step 1: 2 × 4 = 8 → digit 8, carry 0
Step 2: (1×4) + (2×1) = 4 + 2 = 6 → digit 6, carry 0
Step 3: (3×4) + (1×1) + (2×2) = 12 + 1 + 4 = 17 → digit 7, carry 1
Step 4: (3×1) + (1×2) = 3 + 2 = 5 + carry 1 = 6 → digit 6, carry 0
Step 5: 3 × 2 = 6 → digit 6, carry 0
Answer: 66768
Check: 312 × 214 = 66768 ✓
Example 4: 1234 × 5678 (4-digit × 4-digit)
The pattern continues for any digit length:
1 2 3 4
× × × ×
5 6 7 8
Partial products (right to left):
- 4 × 8 = 32 → digit 2, carry 3
- (3×8) + (4×7) = 24 + 28 = 52 + 3 = 55 → digit 5, carry 5
- (2×8) + (3×7) + (4×6) = 16 + 21 + 24 = 61 + 5 = 66 → digit 6, carry 6
- (1×8) + (2×7) + (3×6) + (4×5) = 8 + 14 + 18 + 20 = 60 + 6 = 66 → digit 6, carry 6
- (1×7) + (2×6) + (3×5) = 7 + 12 + 15 = 34 + 6 = 40 → digit 0, carry 4
- (1×6) + (2×5) = 6 + 10 = 16 + 4 = 20 → digit 0, carry 2
- 1 × 5 = 5 + 2 = 7 → digit 7
Answer: 7006652
Check: 1234 × 5678 = 7,006,652 ✓
Example 5: Polynomial Multiplication (x² + 2x + 1)(x + 3)
The same crosswise pattern works for polynomials:
1x² + 2x + 1
× × ×
0x² + 1x + 3
Step 1: 1 × 3 = 3 Step 2: (2×3) + (1×1) = 6 + 1 = 7 Step 3: (1×3) + (2×1) + (1×0) = 3 + 2 + 0 = 5 Step 4: (1×1) + (2×0) = 1 Step 5: 1 × 0 = 0
Result: x³ + 5x² + 7x + 3
Code Snippet: Python Implementation
def urdhva_tiryagbhyam(a, b):
"""
Multiply two integers using Urdhva Tiryagbhyam (vertically and crosswise).
Works for any positive integers.
"""
# Convert to digit lists (reversed for right-to-left processing)
digits_a = [int(d) for d in str(a)][::-1]
digits_b = [int(d) for d in str(b)][::-1]
n = len(digits_a)
m = len(digits_b)
# Result can have up to n + m digits
result_digits = [0] * (n + m)
# Generate partial products using crosswise pattern
for i in range(n):
for j in range(m):
result_digits[i + j] += digits_a[i] * digits_b[j]
# Handle carries
carry = 0
for i in range(len(result_digits)):
total = result_digits[i] + carry
result_digits[i] = total % 10
carry = total // 10
# Remove leading zeros and convert back
while len(result_digits) > 1 and result_digits[-1] == 0:
result_digits.pop()
return int(''.join(str(d) for d in result_digits[::-1]))
# Test
tests = [(23, 14), (87, 93), (312, 214), (1234, 5678), (999, 999)]
for a, b in tests:
result = urdhva_tiryagbhyam(a, b)
print(f"{a} × {b} = {result} (expected: {a*b})")
Expected output:
23 × 14 = 322 (expected: 322)
87 × 93 = 8091 (expected: 8091)
312 × 214 = 66768 (expected: 66768)
1234 × 5678 = 7006652 (expected: 7006652)
999 × 999 = 998001 (expected: 998001)
Code Snippet: JavaScript Implementation
function urdhvaTiryagbhyam(a, b) {
const digitsA = String(a).split('').map(Number).reverse();
const digitsB = String(b).split('').map(Number).reverse();
const n = digitsA.length;
const m = digitsB.length;
const result = new Array(n + m).fill(0);
// Crosswise multiplication
for (let i = 0; i < n; i++) {
for (let j = 0; j < m; j++) {
result[i + j] += digitsA[i] * digitsB[j];
}
}
// Handle carries
let carry = 0;
for (let i = 0; i < result.length; i++) {
const total = result[i] + carry;
result[i] = total % 10;
carry = Math.floor(total / 10);
}
// Remove leading zeros
while (result.length > 1 && result[result.length - 1] === 0) {
result.pop();
}
return parseInt(result.reverse().join(''));
}
// Test
[[23, 14], [87, 93], [312, 214], [1234, 5678], [999, 999]].forEach(([a, b]) => {
console.log(`${a} × ${b} = ${urdhvaTiryagbhyam(a, b)} (expected: ${a * b})`);
});
Common Errors
- Mixing up the cross pattern. For 3-digit, don't jump straight to the full cross — build up step by step: right vertical → narrow cross → full cross → tapering cross → left vertical.
- Forgetting carries between steps. Each partial product sum produces a carry to the next step on the left. Always add the carry before the next multiplication.
- Off-by-one in digit alignment. The cross pattern must align digits correctly. For 2-digit × 2-digit, the middle cross pairs first×last and middle×middle correctly.
- Using Urdhva when Nikhilam is faster. Urdhva works for everything, but Nikhilam is faster for numbers near powers of 10. Choose the right tool.
- Treating 3-digit × 2-digit the same as 3-digit × 3-digit. For different digit lengths, pad the shorter number with leading zeros mentally.
- Dropping the last carry. The final carry from the leftmost multiplication becomes part of the answer. Don't drop it.
- Not practicing mentally. Write the answer from right to left in one line — that's the goal. Initially use paper, then transition to mental.
Practice Questions
- 34 × 23 = ?
- 96 × 87 = ?
- 456 × 123 = ?
- 2025 × 104 = ?
- 9998 × 1234 = ?
Answers:
- 34 × 23 = 782 (3×4=12→2/c1, (3×3+4×2)=17+1=18→8/c1, 3×2=6+1=7 → 782)
- 96 × 87 = 8352 (6×7=42→2/c4, (9×7+6×8)=111+4=115→5/c11, 9×8=72+11=83 → 8352)
- 456 × 123 = 56088
- 2025 × 104 = 210600
- 9998 × 1234 = 12337532
Mini Project: Vedic Multiplier Benchmark
Write a script that benchmarks Urdhva Tiryagbhyam against Python's native multiplication for large numbers (1000+ digits) to see when Vedic approach wins:
import random
import time
def benchmark():
for size in [10, 100, 500, 1000]:
a = random.randint(10**(size-1), 10**size - 1)
b = random.randint(10**(size-1), 10**size - 1)
# Standard multiplication
start = time.time()
result_std = a * b
time_std = time.time() - start
# Vedic multiplication
start = time.time()
result_vedic = urdhva_tiryagbhyam(a, b)
time_vedic = time.time() - start
match = "✓" if result_std == result_vedic else "✗"
print(f"Size {size}: Vedic={time_vedic:.6f}s Std={time_std:.6f}s {match}")
benchmark()
FAQ
Next Steps
Now learn Digital Roots and Casting Out Nines to verify all your multiplication results in seconds.
Related tutorials:
- Nikhilam — faster multiplication near a base
- Paravartya Yojayet — division using transpose and apply
- Python — explore more Vedic algorithms in code
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro