Mastering Mathhammer: The Warhammer 40k Damage Guide
In the grim darkness of the far future, victory isn't just about tactical positioning—it's about understanding the statistical probabilities of every dice roll. This Warhammer Damage Calculator (often called "Mathhammer") allows you to predict the average performance of your units before they hit the tabletop.
How the Calculation Works
The calculation follows the standard sequence of play in Warhammer 40,000:
Hit Roll: Calculated based on Ballistic Skill (BS) or Weapon Skill (WS). A 3+ means a 4/6 (66.6%) chance to hit.
Wound Roll: This compares the Attacker's Strength (S) against the Defender's Toughness (T):
If S is double T: 2+ (5/6)
If S > T: 3+ (4/6)
If S = T: 4+ (3/6)
If S < T: 5+ (2/6)
If S is half T or less: 6+ (1/6)
Save Roll: The target uses their Armor Save modified by the weapon's Armor Penetration (AP). If the unit has an Invulnerable Save that is better than the modified Armor Save, that value is used instead.
Feel No Pain (FNP): A final layer of defense that can shrug off individual points of damage.
Practical Example: Space Marine vs. Ork Boy
Let's look at a standard Intercessor firing a Bolt Rifle at an Ork Boy:
Attacks: 2 shots (Rapid Fire range).
Skill (BS 3+): Average 1.33 hits.
Strength (S4) vs. Toughness (T5): Requires a 5+ to wound. Average 0.44 wounds.
Save (Sv 5+) vs. AP (AP -1): The Ork now needs a 6+ to save. Average 0.37 failed saves.
Final Result: Approximately 0.37 damage dealt per Intercessor.
Why use a Damage Calculator?
By using this tool, you can determine if it's worth splitting your fire or committing your entire squad to a single target. It helps identify "overkill" scenarios and ensures you're utilizing your most expensive units effectively against targets they are mathematically favored to destroy.
function calculateWarhammerDamage() {
var attacks = parseFloat(document.getElementById('numAttacks').value) || 0;
var skill = parseInt(document.getElementById('skillValue').value) || 0;
var strength = parseInt(document.getElementById('strength').value) || 0;
var toughness = parseInt(document.getElementById('toughness').value) || 0;
var ap = parseInt(document.getElementById('apValue').value) || 0;
var damage = parseFloat(document.getElementById('damageChar').value) || 0;
var hitReroll = document.getElementById('hitRerolls').value;
var armorSave = parseInt(document.getElementById('saveValue').value) || 0;
var invuln = parseInt(document.getElementById('invulnValue').value) || 7;
var fnp = parseInt(document.getElementById('fnpValue').value) || 7;
var woundReroll = document.getElementById('woundRerolls').value;
if (attacks <= 0) return;
// Hit Probability
var pHit = (7 – skill) / 6;
if (pHit 5/6) pHit = 5/6; // Nat 1 always fails
if (hitReroll === 'ones') {
pHit += (1/6) * pHit;
} else if (hitReroll === 'all') {
pHit += (1 – pHit) * pHit;
}
var avgHits = attacks * pHit;
// Wound Probability
var woundTarget = 4;
if (strength >= toughness * 2) {
woundTarget = 2;
} else if (strength > toughness) {
woundTarget = 3;
} else if (strength <= toughness / 2) {
woundTarget = 6;
} else if (strength 6) finalSave = 7; // No save possible
var pSaveFail;
if (finalSave >= 7) {
pSaveFail = 1;
} else {
var pSaveSuccess = (7 – finalSave) / 6;
pSaveFail = 1 – pSaveSuccess;
}
var avgFailedSaves = avgWounds * pSaveFail;
// Feel No Pain
var pFnpFail = 1;
if (fnp <= 6) {
var pFnpSuccess = (7 – fnp) / 6;
pFnpFail = 1 – pFnpSuccess;
}
var totalDamage = avgFailedSaves * damage * pFnpFail;
// Update Display
document.getElementById('avgHits').innerText = avgHits.toFixed(2);
document.getElementById('avgWounds').innerText = avgWounds.toFixed(2);
document.getElementById('avgFailedSaves').innerText = avgFailedSaves.toFixed(2);
document.getElementById('totalExpectedDamage').innerText = totalDamage.toFixed(2);
document.getElementById('damageResult').style.display = 'block';
}