Damage Calculator
Combat damage formula tester for RPGs. Attack vs defense, crit chance, resistances, multipliers, armor pen. See expected damage range + crit-adjusted average + damage-per-second. For game balance tuning.
What is this for?
Combat in an RPG is a formula that takes attacker stats and defender stats and produces a number — but which formula? Subtractive, divisive, percent-resist, and custom hybrids all behave differently as numbers scale. A formula that feels fine at level 1 with ATK 10 vs DEF 5 can produce one-shot kills at level 50 with ATK 500 vs DEF 50. This tool lets you plug in the formula and the stats and immediately see expected damage, min/max range, the crit-adjusted average, and DPS at a given attack speed — so you can sanity-check that your level-50 fight isn't accidentally a one-shot.
The formulas
- Subtractive (
DMG − DEF, clamped to ≥ 1) — the simplest. Used in classic Dragon Quest / Final Fantasy. Problem: at high DEF the damage hits the clamp and combat becomes binary (you either can damage or you can't). Easy to break with armor scaling. - Divisive (
DMG × 100 / (100 + DEF)) — the default in modern action RPGs (League of Legends, Path of Exile uses a variant). Damage smoothly decreases as DEF rises, never reaches zero, scales predictably. DEF = 100 means 50% damage taken; DEF = 200 means 33%. - Percent resist (
DMG × (1 − resist%)) — common for elemental damage. Resist 30% = take 70% damage. Cap resist at 75% or 80% to avoid invincibility. - Custom JS expression — for game-specific formulas. Variables in scope:
atk,wpn,def(effective, post-pen),res,pen,armor, plusMath. Expression is evaluated withnew Function, sandboxed to those names.
What the numbers mean
- Expected damage — the formula output at neutral variance. The single-number summary.
- Range — applies the variance % to weapon damage. ±15% is a common default.
- Crit-adjusted average — expected damage × (1 + critChance × (critMult − 1)). The number that matters for sustained DPS, not just a single hit.
- DPS — crit-adjusted average × attacks per second. Compare two builds at this number to decide which is "stronger" on paper.
Common gotchas
- Variance is on weapon damage only. ATK and DEF don't roll. This matches most games — weapon damage is the "physical roll", stats are the static modifiers.
- Armor pen reduces effective DEF, not damage. The order is: effective DEF = max(0, DEF + flat armor − pen), then the formula. This is the standard ordering — applying pen after the formula breaks most balance.
- Resistance is multiplicative. Two 30% resists on the same damage type don't stack to 60%; they stack to (1 − 0.7×0.7) = 51%. For the tool, enter your total effective resist, not the sum of sources.
- Crit multiplier is total, not bonus. A 2× crit means 200% of normal damage, not 100% + 100%. If your game uses bonus stacking, convert before entering.
- DPS is a paper number. Real combat has cooldowns, dodges, positioning, animation lock, and resource costs. DPS is a starting point for balance, not the destination.
- Custom expressions evaluate live. Don't reference DOM, globals, or storage. The sandbox is just
Math+ the named variables. Errors show inline.