Trample works by requiring the attacking player to assign at least lethal damage to each blocking creature before assigning any damage to the defending player (or planeswalker). Lethal damage is defined as damage equal to the blocker's toughness minus any damage already marked on it (CR 702.19b).
Crucially, the rules define lethal damage purely in terms of the amount of damage needed to normally destroy a creature — it does not factor in replacement effects or abilities like indestructible that prevent the creature from actually dying (CR 702.19c). So even though an indestructible creature will survive, the attacker still only needs to assign damage equal to its toughness to satisfy the trample requirement.
Any damage beyond that minimum can be freely assigned to the defending player. The fact that the blocker won't be destroyed by that damage is irrelevant to the assignment calculation.
Example: Your 6/6 trampler attacks and is blocked by your opponent's 2/2 creature with indestructible. You must assign at least 2 damage to the blocker (its full toughness), and you may assign the remaining 4 damage to the defending player. The 2/2 survives due to indestructible, but your opponent still takes 4 damage.
Relevant rules: CR 702.19b (trample definition), CR 702.19c (lethal damage calculation ignores abilities like indestructible), and CR 510.1 (combat damage assignment rules).
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.