DJBC Mathhammer

Warhammer 40,000 10th edition probability calculator

What is DJBC Mathhammer?

Mathhammer is a probability calculator for Warhammer 40,000 10th edition. It answers the question: "If I shoot or fight with this unit against that unit, how many models am I likely to kill?"

Rather than rolling dice and hoping for the best, you can plug in your units, tweak the options, and see the full kill distribution — not just the average, but the range of likely outcomes. This helps with target priority, list building, and understanding how your army performs on the table.

How to use it — step by step

  1. Choose your Attacker. Select a faction from the dropdown, then pick your unit from the list. You can also type in the search box to find a unit quickly. The app uses live Wahapedia data, so stats are always up to date.
  2. Set the model count. Use the Min / Max / Custom selector to set how many models are in the attacking unit. This matters — a 10-man squad fires more shots than a 5-man combat squad.
  3. Select weapons. Choose which weapon each model is firing or fighting with. The Models field controls how many models carry that weapon; Each controls how many times each model fires it (for weapons that can be used multiple times). Use the Fire Order field to control which weapons fire first — lower numbers fire earlier, which matters when kills reduce the pool of models available to fire later weapons. Click Add Weapon to add a second weapon type if your unit has a mix.
  4. Attach a Leader (optional). If your unit is led by a Character, select them from the Leader dropdown. Their conferred abilities (re-rolls, keyword buffs, etc.) are applied automatically. Choose the leader's weapons too — leaders always fire after the unit and are never removed as casualties.
  5. Add Army Characters (optional). Support characters that buff the whole army — such as Primarchs or named HQs — can be added via the Army Characters panel. Their aura abilities are applied on top of the unit's own leader bonuses.
  6. Choose your Defender. Pick a faction, unit, and model count for the unit being attacked. If any models are sheltering in cover, set the In Cover counter (appears automatically for ranged attacks).
  7. Set abilities and conditions. Detachment and faction abilities appear as checkboxes — tick the ones that apply. Range-based conditions (like Target within 9") appear when a leader with that ability is selected. Tick Remained Stationary on the attacker panel if the unit did not move this turn (gives +1 to hit for Heavy weapons).
  8. Hit Calculate. Results appear on the right: average kills, wipe probability, a kill distribution chart, and a per-weapon breakdown showing exactly how each weapon contributed.

Understanding the results

Average kills

The expected number of models removed from the defending unit across all dice outcomes. This is the single most useful number for target priority decisions.

Wipe probability

The chance of killing every model in the defending unit outright. Useful for knowing whether you can risk leaving a unit alive, or whether you need to commit more firepower.

Kill distribution chart

A bar chart showing the probability of killing exactly 0, 1, 2… N models. The shape tells you how consistent the attack is — a tall narrow spike means reliable output; a wide flat spread means high variance.

Wound distribution (single-model units)

For targets with only one model (characters, vehicles, monsters), the chart switches to showing wound distribution — the probability of dealing exactly 0, 1, 2… N wounds to that model. The average wounds dealt is also shown.

Per-weapon breakdown

Expands to show the average outcome for each weapon slot individually — hits, wounds, unsaved wounds, and average damage. Useful for seeing which weapon in your loadout is doing the heavy lifting. When cover is active, the Unsaved card shows the cover-adjusted save for models in cover and the standard save for those outside it.

Fight-back

If you are modelling a melee fight, the defender can fight back. Select their melee weapons in the defender panel. The results show how many models the defender kills in return, accounting for the fact that models killed in the attacker's phase fight back one fewer. Models are removed from the largest weapon group first; within a group, the latest-firing models go first, and within that the highest-damage weapons are removed last.

Weapon keywords

The app automatically reads weapon keywords from Wahapedia and applies them where possible. Some require you to confirm a game-state condition via a checkbox:

Melta X

Tick In Melta Range when the attacker is within half the weapon's range. The bonus damage is applied automatically.

Heavy

Tick Remained Stationary on the attacker panel if the unit did not move this turn. This applies +1 to hit for every Heavy weapon in the unit simultaneously.

Rapid Fire X

Tick In Half Range when the attacker is within half the weapon's range. Adds X extra attacks per model.

Blast

Applied automatically based on the number of models in the defending unit. Adds 1 attack per 5 models (rounding down) — no checkbox needed.

Lethal Hits

Unmodified 6s to hit automatically wound, bypassing the wound roll entirely. Applied automatically — no checkbox needed.

Sustained Hits X

Unmodified 6s to hit generate X additional hits. Applied automatically — no checkbox needed.

Devastating Wounds

Unmodified 6s to wound bypass armour saves and deal mortal wounds equal to the weapon's damage. Applied automatically — no checkbox needed.

Torrent

The weapon auto-hits — no hit roll is made. Applied automatically when the weapon has this keyword.

Ignores Cover

The weapon negates the defender's cover save bonus entirely. Applied automatically — no checkbox needed.

Cover saves

When some or all defender models are sheltering in cover, the In Cover counter appears on the defender panel (ranged attacks only — cover does not apply in melee). Set it to the number of models currently in cover.

Cover gives +1 to the armour save (not the invulnerable save). The covered models form their own allocation pool and absorb wounds first; excess damage then flows to uncovered models. The per-weapon breakdown shows the effective save separately for each pool.

Cover does not apply in two cases:

  • The weapon has the Ignores Cover ability. Note: Torrent only means auto-hit — it does not bypass cover unless the weapon also has Ignores Cover.
  • The unit's armour save is already 3+ or better and the weapon has no AP — the cover bonus cannot improve a 3+ against an AP 0 weapon, since a natural 1 still fails.

Attack fire order

Every weapon slot has a Fire Order number. Lower numbers fire first. This matters because models killed by an earlier weapon are no longer available to fire later weapons — so the order in which you resolve weapons affects the total output.

Default fire order is assigned automatically:

  • Unit weapons start at 1, 2, 3… in the order they are added.
  • Leader weapons default to higher numbers (firing after unit weapons).
  • Attached unit weapons default higher still.

Defender wound allocation priority

When a defending unit contains models with different defensive profiles — such as a unit with a Brute Shield bearer at the front, or Cryptothralls accompanying a Cryptek — use the Add Unit button in the defender panel to add those models as separate pools. Each pool absorbs wounds in priority order before the next one.

The Wound allocation priority field on each pool controls the order: lower numbers take wounds first. Pools with the same priority number are resolved together before moving on.

Tick Leader for any pool that is a Character attached to the unit. Leader pools are always pinned to last in the allocation order regardless of their priority number, reflecting the 10th edition rule that leaders can only be targeted once all other models in the bodyguard unit have been removed.

Excess damage that kills the last model in a pool overflows to the next pool, modelling the multi-damage weapon carry-through rule.

Hit modifier stacking

The app correctly handles two distinct types of to-hit modifier:

  • +1 / –1 to the Hit roll — the net modifier from this source is capped at ±1 per 10th edition rules. Multiple sources of "+1 to hit" do not stack beyond +1.
  • Improve BS/WS by N — this improves the stat itself rather than the roll and stacks freely. A unit with BS 4+ whose BS is improved by 1 effectively has BS 3+.

Bonuses of both types stack with each other. A unit with a +1 to hit roll and a +1 BS improvement gets an effective +2 to hit overall. These bonuses are applied automatically from leader and detachment abilities where the app can parse them.

Unit abilities and conditions

Many units have datasheet abilities that improve their attacks. The app reads these automatically from Wahapedia and applies them where it can. Abilities that depend on game state — such as "if the target is a MONSTER or VEHICLE" or "within 9" — appear as checkboxes so you can confirm whether the condition applies in your specific situation.

Detachment and faction abilities (from your chosen detachment) also appear as toggles. Only tick the ones that are active for the attack you are modelling.

Abilities the app cannot fully parse are shown as plain text for your reference — apply any relevant modifiers manually using the custom options.

Loading an army list

You can paste an army list exported from the Warhammer 40,000 app to speed up unit selection. Click the From List tab in either panel, paste your list, and click Load. Units and their equipped weapons will be pre-populated from the list, and leader assignments will be suggested automatically.

Tips

  • Use Max models for a full-strength unit, Min for a combat squad or minimum-size unit.
  • Add multiple weapon slots to model a unit where different models carry different weapons — e.g. a squad where one model has a special weapon and the rest have bolters.
  • The Each field handles weapons with multiple profiles or models that shoot twice.
  • For vehicles and monsters with degrading profiles, tick In damaged state if the model is below its damage threshold.
  • Fight-back results show the most likely cost of charging — compare kills dealt vs kills received to decide whether a charge is worth it.
  • Use Army Characters for Primarchs and named HQs whose auras affect the whole army, not just their attached unit.
  • The In Cover counter only appears when you have selected ranged weapons — melee attacks are unaffected by cover.

v1.3.0

May 2026
  • Cover saves — "Models in cover" counter on the defender panel (ranged attacks only). Covered and uncovered models form separate wound pools; the Unsaved breakdown card shows the effective save for each pool independently.
  • Hit modifier stacking — correctly separates "+1 to Hit roll" (capped at net ±1) from "improve BS/WS" (uncapped, stacks on top).
  • Ignores Cover ability — now parsed from all unit, leader, and detachment abilities, not just weapon keywords. Abilities that grant Ignores Cover alongside other bonuses are split into independent checkboxes (e.g. T'au For the Greater Good: two separate toggles for +BS and Ignores Cover).
  • Remained Stationary — unit-level checkbox applies Heavy weapon +1 to hit across all weapon slots at once.
  • Army Characters — dedicated panel for Primarchs and whole-army aura characters whose buffs apply beyond their attached unit.
  • Weapon fire order — each weapon slot has a priority number; lower fires first, reducing the model pool available to later weapons.
  • Attacker attached units — supporting units can be added to the attacker, with their own weapons and fire order.
  • Fight-back deterministic removal — casualty order: largest weapon group first, then highest fire order number, then highest damage weapons last.
  • Version footer — app version and Wahapedia data pull date shown on every page.

v1.2.0

April 2026
  • Defender wound allocation pools — add multiple unit types to the defender (e.g. Bullgryns + Cryptothralls) with configurable wound absorption priority and leader pinning.
  • Wargear pools — model sub-groups with different defensive profiles (e.g. Brute Shields) handled as sequential pools within the same unit.
  • Fight-back weapons — defender melee weapons and fight-back results for the full combat exchange.
  • Stealth and hit penalties — enemy hit penalties parsed from unit abilities and propagated through the damage pipeline.
  • Primarch / aura ability parsing — leader abilities with whole-unit or aura language correctly identified and applied.
  • Admin dashboard — visitor counts, calculations per day, top matchups, feedback inbox.
  • Army list import — paste a Warhammer 40,000 app export to pre-populate units and weapons.

v1.1.0

March 2026
  • Kill distribution chart — full probability distribution, not just average kills.
  • Leader support — attach a Character leader with their own weapons; conferred abilities (re-rolls, keywords) applied automatically.
  • Detachment and faction abilities — parsed from Wahapedia and surfaced as checkboxes.
  • Conditional abilities — range-gated and target-type-gated abilities shown as user-confirmable checkboxes.
  • Melta, Rapid Fire, Blast — range-state conditions exposed as per-slot checkboxes.
  • Feel No Pain — included in the full attack sequence.
  • Damaged state — degrading stat profiles for vehicles and monsters.

v1.0.0

February 2026
  • Initial release — average outcome calculator for the full 10th edition attack sequence: hit, wound, save, FNP, damage.
  • Faction and unit selection via live Wahapedia data.
  • Weapon keyword parsing: Lethal Hits, Sustained Hits, Devastating Wounds, Torrent, Heavy.
  • Invulnerable saves, Feel No Pain, multi-damage weapons.

Feedback

Found a bug, missing a unit ability, or have a suggestion? Let us know: