HERZ: Shinji, Asuka and Rei were willing to sacrifice themselves to stop SEELE and give Akiko a chance to be happy. After the Final Battle Shinji and Asuka survived, but Rei sealed herself out of Earth to save them.
Higher Learning: Rei III replaces Rei II right before the battle against Armisael to give the latter a chance to keep living. As a reward, Rei II shares her memories with Rei III in the last moments before her death, and Rei III dies happy, knowing exactly what she's giving her life to protect.
In A History of Magic Sadako Sasaki (the girl who died from leukemia as a result of the Hiroshima bombing, and the inspiration of the Thousand Origami Cranes trope) chose this when she used her wish to wish that the atomic bomb never was used again, rather than wish herself cured of leukemia. She thinks it a worthwhile sacrifice, bringing a rare moment of remorse from Kyubey.
In the post-Madoka world, where the masquerade is broken and there's prejudice on both sides, the Puella Magi and the humans are on the verge of war, aggravated by humans sending brainwashed Puella Magi to kill the Magi in positions of power. Billy Kane, the man that technically broke the masquerade (long story why), decided to take the blame for the brainwashed magi assassins in an attempt to stop the war from happening. It somewhat works, though a huge Demon outbreak helped,.
At the very end of the fic, humanity and magi are almost completely wiped out. Kyubey tells Homura that the Incubators plan on taking the last human, cloning it, and using that to create a new stock of humans to make Puella Magi from, and they were willing to wait until Homura died from her fatal injuries to take the baby unless she killed the baby herself. Homura made a wish and sacrificed her chances of ever seeing Madoka again to ensure this baby made it into Madoka's heaven and they both died. The sacrifice was enough to reunite Homura with Madoka anyway, and bridge the heavens between Puella Magi and humans.
Ultimately subverted with Apple Bloom, who is willing to do the same as Bayonet to defeat Queen!Twilight (and later, the Darkness), but survives.
In the Disgaea fanfic The Curse of Blood Laharl blocks a spear strike that kills him to protect Etna. From his brainwashed mother no less.
In Human Curiousity, a number of Nations sacrifice their own chances to escape the HCS facility - leading to their own deaths - in order to secure the freedom of their friends and family. Among them were Scotland and Switzerland (who stayed behind and drew HCS fire so England and Liechtenstein respectively could escape), Denmark (who held back HCS soldiers so Estonia could continue on) and Russia and Belarus (who held off the HCS soldiers that tried to stop England and Liechtenstein from making it outside).
G1 Mimic pulls a You Shall Not Pass on Discord to let her friends and daughters escape. In the process, she manages to shatter his fang before he kills her in his fury, being the only mortal to ever hurt him permanently.
Amicitia sacrifices herself to create Shining Armor and the Interviewers from her existence.
The Bushwoolie Wishful sacrifices himself to make sure the Green Smooze is cast into Discord's realm, also fusing with it in the process and rendering it innocent and child-like.
Minuette throws the fob watch containing The Master at the Blank Wolf after the Master threatens to harm her friends. Since she was created by the Master, she did this believing she would be destroyed as soon as the Master was destroyed. Fortunately, she survives.
During the Finale Arc the Dark World Nightmare Mirror (who's actually purified internally but still a Nightmare on the outside) sacrifices herself to protect Prime!Applejack from one of Nyarlathotrot's attacks, giving Applejack her power and transforming her into Princess Veritas.
During the Finale Arc Button Mash realizes that if Discord is stopped, this version of him may cease to exist, as his past had been altered by the Rumors and everything he'd done since the Rumors started would have never happened. At first, he attacks Apple Bloom to stop her from advancing, fearing for his life and existence, but eventually decides to be a true hero and lets her pass. When the crisis is over, the Elder Gods reward him by bringing him back with his memories intact.
Subverted comically in Calvin and Hobbes: The Series - Hobbes pulls one of these off while fighting Clock King, and while Calvin dramatically monologues over his body, Hobbes walks in with ice cream, revealing the sacrificed one to be Socrates.
In the Children of Time version of "Evolution of the Daleks," the half-human Dalek Sec offers himself in exchange for the liberation of the Daleks' captured Time Lord, Kit Bennett. It... doesn't work. Then he ends up taking the fire of his own children in defense of his one remaining brother, Jast. He dies after one last plea with his brother for peace.
Twice in Hedgi's ''History Repeats'' series. First in A Captive Light when T.K. takes an energy blast meant for Kari and appears to be dead and second in A Fading Hope when Kari puts herself in harm's way to save T.K. again, she survives, but Gatomon does not.
Officer Johnny takes one for the team in Pokéumans so Brandon and Reggie can make it back to the Long Island base.
In The End of Ends, Count Logan's minions hold down Beljar to allow the heroes to land the final blow. Why? Because they trust Logan so much that they're willing to give their lives for him.
In episode 3 Doc the Metool does this to save Roll.
QN-60 and Dr. Cossack almost do this to save people, but Mega Man saves them.
In episode 10, Ballade does this.
In Episode 77 of Sonic X: Dark Chaos. Tails is crippled and nearly possessed by Dark Tails. He fights against the influence of Dark Tails for as long as he can, and Cosmo is forced to fire the Sonic Driver at them, permanently killing them both.
In The Light Never Goes Out Spike saves the Mane Six from a collapsing mountain in their last adventure together 50 years prior to the story. The sequel explains that Spike helps keep the ceiling of a mountain cave up long enough for a dazed Rarity to be carried out by Fluttershy and Rainbow Dash when a meeting with the half-dragon, half-pony Greyhorn goes south.
In The Land Before Time fanfic The Seven Hunters Skytail sacrifices himself in a last ditch effort to poison Calin. This act not is an act of vengeance for the loss of one of his packmates, but it also buys his surviving followers time to escape.
In The River Variations John pushes Sherlock out of the way in order to take the bullet for him. He is shot twice in the chest and is rushed to the hospital. John sacrifices himself for Sherlock.
In the 25th Kill la Kill AU, we have this with Ragyo, going into the basement to save Nui's life from whatever was down there. This left her mortally injured.
In Technomad's Lord of the RingsAU Fic "Death Seeker" Grima Wormtongue, having been inadvertently freed from Saruman's influence when Theoden was, rides with the host of Rohan, seeking to die. He ends up helping take down the Lord of the Nazgul and finally gets his wish.
Twitchy in the Golden Age series dies saving Karkat from falling debris during the Condesce's attack on Excelsis-Five.
The plot of Pokémon fanfic Rotten Luck kicks off when protagonist Jonathan, after just having brought a gift for his date, saves Sam Blueland (then just a nameless boy with a Zigzagoon playing with a ball) from getting run over by a car. Jonathan would reincarnate as a newborn Ralts almost immediately thereafter.
In Alternate Destination, Gaia knows very well that by tampering with the timeline to bring LinkaBack from the Dead, she could lose her powers, spirit status and immortality. She still does go through with her plan, but its long-term consequences eventually kill her.
In Blue Sky, Wheatley decides to invade GLaDOS' systems, and overwhelm her with ideas that she considers bad, using a mechanism inside his own programing that made him think all his bad ideas are good. He succeeds in shutting down GLaDOS, but at an awful price: He is stuck as files. He is eventually going to essentially fade into nothing. He survives and gets a body as a thank you from Caroline.
In Kill Or Be Killed, Yoona's seat breaks on a ride, and Yesung catches her before she falls. Yoona convinces him to let her go, since she feels she is ready for death.
Captain Jojo Appiah of Starbase 234 gives his life in a holding action against the Heralds to cover the fleet's retreat from battle, finally self-destructing his station to avoid capture.
Double Subverted with Rear Admiral Zandra Taitt. She planned to use technobabble to make the Heralds gate into a black hole and then bail out of the USS Caelian before it was destroyed as part of the plan, but the Heralds showed up too early so she didn't have time to get off.
The heavily damaged Benthan flagship sacrifices itself to shield the Bloodwing from a Herald ramming attack. At least some of the crew get out in the Escape Pods, though.
In The Things We Leave Behind, after an Ursa Major attacks Ponyville, Twilight decides to try using an age reversal spell to stop it. Doing so uses up so much of her magic that she has to resort to drawing power from her Life Force to continue. She succeeds, but falls into a coma and dies shortly afterward.
Sudden Contact: Tassadar (like in canon) and Adrien Victus give their lives to destroy the Overmind.
In Thousand Shinji, Misato got killed when she shielded Shinji from the bullets of a firing squad.
Wonderful!: Danny died to save his daughter Taylor and everyone else from psychopatic mass murderer Jack Slash.
Much like in Dragon Age: Inquisition, Victoria insists on being the one to do this at Haven in All This Sh*t is Twice as Weird. She points out to her counterpart Mahanon that his Dalish clan needs him to survive, while the world can get on just fine with one less Trevelyan. It's arguably more painful than in the game, because instead of showing her making the sacrifice, the narrative focuses on how Mahanon deals with his Survivor Guilt.
The backstory of the Pokémon fanfic Return of the Hero is that after rescuing Ho-Oh from the evil Sky Soldiers, Ash Ketchum transferred his Aura, or Life Energy, to the bird Pokemon in order to revive it after it was mortally wounded, and died as a result. Ten years before him, such an act was performed by Frank Ketchum, Ash's father.
In The Motion of the Stars, Rarity sacrifices herself and binds her soul to the Sun to restart and guide its motion, like the ancient unicorn monarchs did before the time of the Sisters.
In Thunderstorm and the Four Winds, Thunderstorm sacrifices herself to destroy the High King and free the pegasi from the scourge of wild, uncontrolled weather.
In the Pokémon Reset Bloodlines sidestory "Twenty Gyarados Bill Gaiden", the titular Villain Protagonist is brought down by Elite Four member Denki Tekina. Their final clash ends up in a Hyper Beam collision between Bill's Mega Gyarados and Denki's Mega Ampharos, and the resulting explosion leaves the former two fatally wounded and kills the latter two.
Yiereth in The Form of Survival crashes her starfighter into the ship preparing to shoot down the Ghost, saving her lineage-nephew in the process.
In Ojos Que No Ven, Miguel pushes his baby sister Coco out of the way from an oncoming truck and he gets killed instead, which starts the story.
When Discord first attacked Equestria Tydal fought him to buy Celestia and Luna the time to get to the Tree of Harmony and in the end held Discord down so they could fire the Elements at the two of them; Discord was turned to stone and Tydal was so injured Celestia and Luna had to turn him to stone as well so he could heal.
During the Tydal vs. Tirek arc it quickly becomes clear to Tydal that Tirek, with Celestia, Luna, and Cadence's magic, is too powerful for him to stop. He distracts Tirek just long enough for him to figure out how Tirek performs his Magic Theft spell and uses it against Tirek, stealing his natural magic so that Tirek can never again steal another pony's magic. Tydal then uses the last of his strength to cast a spell that causes him to seemingly explode, distracting Tirek just enough that Twilight and her friends can defeat him.
During the Battle of Thessia in the Mekon War, the crippled Asari dreadnaught Siege Perilous rams a Romulan warbird, the resulting explosion wiping out several other nearby Romulan ships and tipping the odds in the favor of the allied forces.
During the Vinn War, there's at least one example of a ship — the Japanese cruiser Ashigara — self-destructing in order to both destroy enough Vinn vessels for its surviving squad to escape, and to deny the Vinn access to their Warp engines to reverse-engineer.
Also during the Vinn War, Sky Marshal Erica Hernandez self-destructs her crippled ship in order to destroy a large number of invading Vinn ships.
During the Continuum of Makers' battle with the Reaper Herald and its Indoctrinated fleet, a Maker ship destroys a larger Indoctrinated vessel's Ring Drive with their own, creating an event which destroys Herald and all its ships.
A similar move is used during the Final Offensive of the Reaper War, in order to defend the Continuum's homeworld.
Trapped in a Conspiracy of Light base being overrun by Collectors, Benezia and Hot Rod trigger the Self-Destruct Mechanism, destroying themselves and the whole facility in order to keep the Collectors from taking over the base's defenses and using them to destroy their colleagues' evacuation ship.
Ramjet holds off a horde of Husks to allow Stealth Assault to escape with some Turian refugees, and gets overrun.
Xerneas overclocks its powers to restore life to all the Husks on ARC3-US, burning out its own life force in the process.
When the Reapers invade Romulus and an invasion force marches on the capital, Ael T'Vrahu drives among them and lets herself be the target of an orbital strike in order to wipe them all out.
When a Kryptohusk is unleashed during the Second Battle of Sol, Superman restrains her long enough to call down an antimatter torpedo strike on their position, obliterating them both.
During the assault on the Reapers' Dark Space base, the Maker Admiral Carad allows the last Kryptohusk to attack his ship, keeping it distracted and still long enough for a Klingon ship to attack, destroying it along with the ship.