Two formulas, the same in 2014 and 2024 (SRD 5.1 class Spellcasting features; SRD 5.2 "Character Creation", Spellcasting):
- •Spell save DC = 8 + your proficiency bonus + your spellcasting ability modifier
- •Spell attack bonus = your proficiency bonus + your spellcasting ability modifier
Your proficiency bonus comes from your total level (the proficiency bonus calculator has the table), and your spellcasting ability is set by the class that gave you the spell: Intelligence for wizards, Wisdom for clerics, druids and rangers, Charisma for bards, paladins, sorcerers and warlocks. The same fixed-number pattern gives your passive Perception, which is 10 plus your Perception bonus.
Worked example
A level 5 wizard with Intelligence 18 has a +4 modifier and a +3 proficiency bonus. Spell save DC = 8 + 3 + 4 = 15; spell attack = 3 + 4 = +7. Against a creature with a +0 Dexterity save, a Fireball fails on a roll of 1–14, a 70% chance. A Fire Bolt (+7) against AC 15 needs an 8 or higher: 65%. Raising Intelligence to 20 at level 8 adds 1 to both numbers.
Magic item bonuses
Some items add to one or both numbers. They are item bonuses on top of the formula, so the calculator keeps them in their own boxes:
- •Robe of the Archmagi: +2 to spell save DC and spell attack bonus (in both SRDs).
- •Rod of the Pact Keeper: +1, +2 or +3 to the save DC and spell attacks of warlock spells (Dungeon Master's Guide).
- •Wand of the War Mage: +1, +2 or +3 to spell attack rolls only, not the DC (Dungeon Master's Guide).
Multiclass casters
Each spell uses the ability of the class you prepared it with, so a paladin/warlock has one Charisma DC, but a cleric/wizard has a Wisdom DC for cleric spells and an Intelligence DC for wizard spells. The proficiency bonus is shared (it comes from total level). Check slot totals with the multiclass calculator and track them in play with the spell slot tracker. For what each spell does with a failed save, see the spell guides.