->'''Rumplestiltskin:''' Did I not tell you that I can have your son slay the dragon? And am I not a man of my word?\\
'''King George:''' I thought you said he was gone forever!\\
'''Rumplestiltskin:''' That he is. But his ''brother''...\\
'''King George:''' His ''what?!''\\
'''Rumplestiltskin:''' His twin brother. Did I not mention there was another?\\
-- ''Series/OnceUponATime''

So you have a setting with a monarchy, or where heredity is somehow important (say SuperpowerfulGenetics are in effect), and the entire royal / SuperFamilyTeam are under constant threat of being killed in a surprise attack by their enemies. Sure they'll fail 99% of the time, and most royal families have a SpareToTheThrone to [[HeirClubForMen ensure there's a someone to inherit]], but what to do in case they somehow wipe out ''everyone'' in the line of succession ([[TheEvilPrince who isn't evil]])? EvilOnlyHasToWinOnce after all.

The solution is to raise one of the [[LostOrphanedRoyalty King's children as a commoner]] far away, without knowledge of their SecretLegacy. The idea being that they'll be [[KingIncognito safe in anonymity]], and they may even be able to be trained or schooled in a way that spares them from becoming snobby and [[ModestRoyalty brings them closer to commoners.]] The HiddenBackupPrince isn't always created intentionally. The kid may be a bastard child and hidden to cover up their father's indiscretions, a twin who is sent away to avoid complicated succession rivalries, or is somehow kidnapped or separated unintentionally.[[note]]In many cases historically, illegitimate children were specifically excluded from inheriting.[[/note]]

Of course, if the HiddenBackupPrince is resentful and [[ReallyRoyaltyReveal finds out about their heritage]] they may decide to ''be'' the cause that wipes out the royal family. Nothing like going from RichesToRags to motivate spite. Usually though, the HiddenBackupPrince will know nothing of their heritage yet somehow get involved in the plot regardless.

See also RagsToRoyalty. May overlap with BackupTwin.

For the sake of keeping things simple, this trope will cover both intentionally and unintentionally creating a HiddenBackupPrince. Cases such as involuntary separation (through chance or enemy schemes) count. This trope can also be in play even if the royal family isn't killed off-- the HiddenBackupPrince exists as a fail safe, regardless of if it's called into use by the plot.
----
!!Examples:

[[foldercontrol]]

[[folder: Anime and Manga ]]
* In ''Anime/GoLion'', the royal family of Altia is killed, save for Princess Fala, who was taken away when the planet was attacked.
* The short-lived manga ''Manga/{{Barrage}}'': It's revealed towards the end that [[spoiler: Astro was the real prince all along; he was stolen shortly after birth and replaced with a [[ArtificialHuman "dark matter duplicate"]] so that he could be raised away from the corruption of the court.]]
* ''Manga/MagicKnightRayearth'': Princess Emeraude's younger brother Ferio. In the manga, he's [[KingIncognito Prince Incognito]]. In the anime, [[LaserGuidedAmnesia his memory of being royalty has been temporarily erased]].
* ''{{Ooku}}'': After a plague kills all male claimants to the shogunate, the previous shogun's nurse seeks out the only remaining member of the line, an illegitimate daughter who had been kept a closely-guarded secret, and puts her on the throne--at first in disguise, later openly ruling in, well, she stuck with her father's name but using her own face and female attire counted for much.
* Inverted in ''FushigiYuugi''. The crown prince was a boy named Tendou, and in order to protect his life [[spoiler: from one of the concubines, who wanted ''her'' son, Hotohori, on the throne]], his father sent him to [[PrincessInRags live as a commoner]], with the intention of bringing him back to the royal family when the heat was off. Which never happened. [[spoiler: Ironically, Tendou's ex-girlfriend Houki ends up being taken to be part of the RoyalHarem, and ends up marrying Hotohori, who looks just like Tendou.]]
* ''SpacePirateMito'' cites ''preventing'' her son from becoming the hidden backup prince as her primary reason for hiding him in the first place. (It didn't work.) She would have been perfectly happy to allow the usurper to continue ruling the galaxy if he'd just left her boy alone.
[[/folder]]

[[folder: Film -- Live Action ]]
* In ''KingRalph'' after the entire British Royal Family is wiped out in a photography accident Ralph is found working as a lounge singer in Las Vegas and recruited to be the new King of England. He didn't know he was related to the monarchy at all - he's a royal bastard, his grandfather having been a Duke and his grandmother a hotel maid. [[spoiler: The same is true of Sir Cedric]].
* Princess Leia in ''Franchise/StarWars''. It's a bit of a twist from the normal set up, but she and her brother Luke are being hidden from forces meaning them ill (though it's unusual for this trope that it be their own father). Which at least in her instance is especially ironic since she was a commoner and hidden by posing as royalty.
** In the ExpandedUniverse, high-ranking Chiss families invoke this trope with the use of "shadow children." A child of a prominent family will be given up at infancy and raised by a different family entirely, so that an attempt to wipe out an entire clan will (in theory) result in GenocideBackfire.
* Disney's ''Film/TheManInTheIronMask'' has the King's identical twin hidden in a cottage by their father to avoid a power struggle. The king being a jerk means [[spoiler:as soon as he finds out he has a brother who might potentially try to usurp him he goes all out and has him jailed and put in the titular iron mask.]]
* This is the {{Backstory}} for ''both'' main characters in Uwe Boll's ''InTheNameOfTheKing'' films. The difference is that no one planned for Farmer to be raised as, well, a farmer. He was presumed killed in a raid along with his mother. He was instead saved by a stableboy and raised as his own. It's possible the stableboy didn't even know who the kid was.
* The baby prince hidden by the Black Fox and his band in ''Film/TheCourtJester''.
[[/folder]]

[[folder: Film - Animated ]]
[[/folder]]

[[folder: Literature ]]
* Alexandre Dumas' ''Le Vicomte de Bragelonne'', the second sequel to ''Literature/TheThreeMusketeers'', better known through its film adaptations as ''The Man With the Iron Mask''. It is about Louis XIV's supposed twin brother.
* In ''Discworld/WyrdSisters'', the king's infant son, Tomjon, is hidden away to protect him from his murderous relatives. Unbeknownst to everyone, there's a second son already there - Verence the fool. Though Nanny realizes at the end of the book that [[spoiler:neither is the king's son; they're both children of Verence's father, the previous fool.]]
** Captain Carrot is implied to be the accidental version of this trope, but he has no interest in ruling Ankh Morpork, so its current ruler leaves him be.
* Mia Thermopolis from ''Literature/ThePrincessDiaries'' was the illegitimate daughter of the Prince of Genovia. Since the Prince was unable to have anymore children due to his cancer treatment, he was forced to reveal to Mia that she is his only heir to the Genovian throne.
* The first Prince Geran from the ''Literature/{{Belgariad}}'' prequels was hidden away only after the rest of his family got butchered.
* In ''Split Heirs'' by Creator/LawrenceWattEvans and Creator/EstherFriesner, the King's people believe that twins are a sign of infidelity, so when Queen Artemisia gives birth to ''triplets'', she gives two of them to a nurse who gives them to two other families to raise as commoners. The rest of the book is a hilarious deconstruction of PrinceAndPauper tropes.
* In Creator/AndreNorton's ''The Prince Command'', Michael was raised in America in total ignorance of his birth. Only when his grandfather and cousin died does he learn he was the rightful heir. (To be sure, this was the consequence of his father running away and marrying in America.)
* This trope is the {{backstory}} of "Daniel Draper" in Creator/KatherineKurtz's Literature/{{Deryni}} works: he was born Prince Aidan Augarin Ifor Haldane and survived the massacre of his parents and six siblings when Prince Festil Furstan conquered Gwynedd in the year 822. The toddler is found hiding during the killings and smuggled out of the palace in a load of laundry by a loyal servant. In the book ''Camber of Culdi'', an elderly Aidan is on his deathbed in 903 and reveals his identity to his Healer Rhys Lord Thuryn. He also [[ExpositionBeam "tells"]] Rhys of his son (who died in the Great Plague of 878) and his grandson, who has lived as a cloistered priest for the past twenty-four years.
* In Creator/TerryPratchett's ''Literature/{{Nation}}'', a flu epidemic has ravaged Britain to the extent that Daphne's father, a man previously 157th in line to the throne, is now heir apparent due to the fact he was sequestered away as governor of a remote Pacific island colony. The book deals with the search to finds him in the wake of a destructive tsunami...
* Prince Tobin in Lynn Flewelling's Tamir Triad is actually a hidden princess, hidden in plain sight via a hideous necromantic spell that involved sacrificing her twin brother at birth to protect her from her uncle the King's desire to subvert their nation's previously matrilineal monarchy through the simple expedient of massacring all of his female relatives. As a prince Tobin is safe, as a princess she's dead meat...and poor Tobin, who's been kept in dark for his own safety, doesn't know what to do when the spell starts to break down under the onslaught of puberty.
* A series of [[SuccessionCrisis Succession Crises]] in the realm of Westeros in ''Literature/ASongOfIceAndFire'' have left more [[HiddenBackupPrince Hidden Backup Princes and Princesses]] than anyone knows what to do with. Matters stem from the collapse of the Targaryen dynasty, which had ruled Westeros for nearly 300 years before it was overthrown and supplanted by a new royal house, the Baratheons. King Robert I Baratheon sired nearly 30 bastard children, but no trueborn heirs. His officially recognized children and heirs were not actually his, but the products of incest between his wife and her twin brother. After their parentage is made public knowledge, their claim to the throne is disputed, but the royal army is the strongest force in the Seven Kingdoms, so they maintain their grip on power [[AuthorityEqualsAssKicking the old fashioned way]]. But waiting in the wings are even more potential successors with blood ties to the Targaryen royal family, including the two surviving children of the last Targaryen king, and their their nephew: the eldest surviving son of their older brother (the former Targaryen heir apparent),who had been thought to be dead (and who might be an imposter). It turns out that [[spoiler:after the Targaryen royal family was overthrown and the last scions were cast into exile, some Targaryen loyalists spirited away the late prince's son as a back-up, in case something should happen to the publicly known Targaryens. Things get complicated when the back-up prince makes himself known and launches an invasion ''before'' the last public Targaryen makes her move]].
** Unconfirmed, but a ''very'' popular [[WildMassGuessing fan theory]] holds that [[spoiler: Jon Snow is actually Rhaegar and Lyanna's son. If true, he could make a claim to the throne as well.]]
** And that's just the Iron Throne:
*** After [[spoiler:the death of King in the North Robb Stark with no known children]], both Bran and Rickon Stark (thought dead) and Jon [[spoiler: Stark (formerly Jon]] Snow, [[spoiler: legitimized by royal decree]] are {{Hidden Backup Prince}}s.
*** Meanwhile, Theon Grejoy is a HiddenBackupPrince [[spoiler: after his father King of the Iron Isles Balon Greyjoy dies and, Theon being presumed dead, his uncle Euron takes over.]]
*** Lord of the Dreadfort Roose Bolton's bastard son Ramsay Snow invokes this by murdering his true-born half-brother. Roose isn't fooled for an instant, but arranges to have Ramsay legitimized anyway rather than father an heir on his second wife and risk his house being subject to misrule by [[AChildShallLeadThem a child lord]] or a RegentForLife.
* Inverted in ''StarOfTheGuardians'' by MargaretWeis. Dion Starfire is hidden away ''because'' he's the only remaining heir to the throne, the remainder of the Blood having been killed during a coup staged by the current government, a PeoplesRepublicOfTyranny. The series begins because TheCallKnowsWhereYouLive.
* Lampshaded, like most everything else about fantasy literature, in the very tongue-in-cheek ''Literature/TheToughGuideToFantasyland'' by DianaWynneJones. It notes that runaway princesses have an overwhelming tendency to marry "commoners of sterling worth" who more often than not turn out to be these.
* The entire plot of ''TheFalsePrincess'' by Eilis O'Neal, where the main character finds out at the beginning she was a decoy so that the real princess could be hidden away and protected.
* This is crossed with ChangelingTale in ''TrylleTrilogy''. Wendy is a troll princess swapped with a human child in order to make sure that the evil Vittra trolls don't kill her.
* Crown Prince Alaric of Caederan in ''Literature/TheQuestOfTheUnaligned'' is an example of this, though with the slight twist that it was done by accident: He was supposed to only stay in Tonzimmiel for about ten years before being informed of his heritage and taken to study with the finest mages in each of the four disciplines. This plane was unwittingly wrecked when Alaric's Tonzimmelian foster parents died and Alaric was spirited off by Tonzimmiel's orphanage system.
* ''Literature/ElementalBlessings'': [[spoiler: Rafe Adova is actually this to ''two'' thrones. His mother, Princess Subriella of Malinqua married into the royal family of Berringey as part of a peace treaty. The problem was that Berringey has the custom of killing off all extra royals once the crown prince was chosen, and Subriella drew the short end of the stick. Rather understandably, she took her baby and fled. She chose Welce, the small-and-out-of-the-way country that's the setting of the novels, since her empress mother knew about the regicide beforehand, and lived out the rest of her life in obscurity, birthing another son along the way.]]
* This is the basis for the plot of ''Spindle’s End'' by Creator/RobinMcKinley.
* Joe Abercrombie's ''Literature/TheFirstLaw'' plays with this, [[spoiler: though it is eventually subverted when it is revealed that the hidden heir was no bastard son of the previous king but rather the son of a whore propped up by the series' resident [[TheChessmaster chessmaster]] as a more pliant rule to succeed the current incompetent, dementia-suffering ruler and his spoiled heir.]]
[[/folder]]

[[folder:Live Action TV]]
* In ''Series/PowerRangersSamurai'', [[spoiler:Jayden and Lauren are heirs to the Shiba family that has led the battles against the monsters since for hundreds of years. During the battle that ultimately killed their father, they were split up; Lauren the firstborn went into hiding to train to defeat the BigBad, while Jayden publicly fought off the monster attacks as the Red Ranger in the meantime.]] Played with in that ''one'' is Hidden and the ''other'' is explicitly the Backup. (''Series/SamuraiSentaiShinkenger'', which this is based on, has a similar arrangement but doesn't quite count since [[spoiler:Jayden]]'s counterpart is merely a BodyDouble and not blood-related to the other.)
* Played absolutely straight in ''Series/OnceUponATime'', with Prince James and his hidden backup twin, raised as a shepherd.
[[/folder]]

[[folder: Oral Tradition ]]
* In the KingArthur mythos Arthur doesn't know he's the heir to the throne, everyone thinks he's a foundling that Sir Ector took pity on; but Merlin trains him in such a way that he ends up a wise and humble king - unlike he presumably would have been if he had grown up as a prince. Arthur doesn't learn of his true parentage until after Uther, his father, dies and he pulls the sword from the stone... and commits BrotherSisterIncest with his older sister, Morgause.
* A later Medieval legend tried to paint Wamba, King of the Visigoths as this, in order to explain his (rather amusing) Crowning ''[[OfferedTheCrown by Force]]''. This is nonsensical because the Visigoths had an ElectiveMonarchy where bloodline didn't determine the next monarch.
[[/folder]]

[[folder: Tabletop RPG ]]
* In the ''TabletopGame/{{Shadowrun}}'' game's setting, the British monarch and several of the bloodline's heirs were reported dead in the wake of the second [=VITAS=] epidemic, throwing the line of succession over to a distant branch of the family. Claims that the previous royals hadn't died, but had goblinized into orks or trolls and been discreetly set aside in favor of their still-photogenic cousins, are a popular conspiracy theory in that Verse.
** In addition, the Japanese Imperial family were killed in a massive earthquake (shades of HarsherInHindsight these days...), save for one young boy. Cue a new dynasty.
* ''TabletopGame/{{Eberron}}'': Karrnath, during the Last War, had a habit of pulling secret royalty out of nowhere right when they were needed, most notably Kaius III, who nobody had even heard of before he took the throne when Regent Moranna went off the deep end. [[spoiler:Except Kaius III is in fact Kaius I and a vampire, pretending to be an example of this trope to let him retake open control of his nation without any awkward questions.]]
[[/folder]]

[[folder: Theater ]]
* In Creator/WilliamShakespeare's ''Theatre/{{Cymbeline}}'': King Cymbeline's sons were kidnapped at a young age by a resentful retainer, and grew up thinking the retainer is their father. At the end of the play they're reunited with their real father.
[[/folder]]

[[folder: Video Games ]]
* Martin in ''VideoGame/TheElderScrollsIVOblivion'' is the illegitimate son of the Emperor, who gave him away to a priesthood. When the Emperor and his legitimate sons are murdered by a cult he's the only one of them left (which is important, since someone of the Septim line is needed to foil the villains' EvilPlan). Given that his line have a habit of seeing the future, it's possible that he invoked this trope.
* Princess Elincia of ''VideoGame/FireEmblemTellius'' was brought up in secret this way, ready to assume the throne should everyone else die, because her parents were afraid of a succession conflict caused by her uncle already having been declared the successor when she was born.
* [[spoiler: Alistair]] from ''VideoGame/DragonAgeOrigins'' is an accidental example; being a bastard, he would normally never have been considered for the throne, but he's the only one with RoyalBlood left. He also takes a lot of convincing, as he has zero experience, and is generally self-deprecating and wary of leadership. [[spoiler: You can convince him to give it a go, let Anora take the throne, or convince them both to marry.]]
* In ''VideoGame/TalesOfTheAbyss'', Emperor Peony's backstory combines this trope with SelfFulfillingProphecy: the Score (an ancient prophecy that predicts the future without error) says that he'll be the one to take the throne despite having three older siblings and being an illegitimate son, so they send him to live in hiding in Keterburg with the excuse of keeping at least one potential heir away from the political scheming and backstabbing of the court. After said political scheming and backstabbing manage to do away with all his siblings, Peony then becomes the Crown Prince for lack of any other viable heirs. It's never made especially clear who, in all of this, knew that he was the one meant to come to the throne, and who was just being manipulated by the well-meaning Church, but it's certain that Peony himself never expected to actually inherit.
* In ''VideoGame/VandalHearts II'', the death of King Zekras of Natra results in a war of succession between his sons Julius and Lagore; when the game begins, both brothers are dead, and by the end of the game, Lagore's son Franz is also dead while Julius' son Nicola has gone into exile. However, depending on decisions made by the player, the throne can ultimately be inherited by Zekras' illegitimate daughter Adele, who was raised believing she was the daughter of a local governor who married her pregnant mother.
* In ''VideoGame/DragonQuestVIII'', King Clavius's brother abandoned the kingdom years before the game took place. When it comes to light that the Hero is Clavius's nephew, he's all too happy to name the Hero his heir instead of his own worthless layabout of a son, [[PrinceCharmless Prince Charmles]] - helps that the Hero somewhat inadvertently passed the RiteOfPassage (when attempting to help Charmles do the same).
* The main character of ''VideoGame/DivinityDragonCommander'' is the illegitimate offspring of the former emperor and his lover, a dragon in the guise of a human woman. Given that he has three legitimate elder siblings, is a bastard child, and [[HalfHumanHybrid half dragon]], he'd ordinarily never be considered for the job. That all changed when his three siblings went insane and started a war that threatens the world. The wizard Maxos sough him out to solve this mess and rule in their place.
[[/folder]]

[[folder: Western Animation ]]
* ''{{WesternAnimation/Animaniacs}}'': Yakko is appointed King of Anvilania this way, as he explains in song.
-->'''Yakko''': I'm [[KnowsAGuyWhoKnowsAGuy the cousin to the sister / Of son's niece's brother / Of the uncle's daughter's father / Of the nephew's sister's mother / And my grandpa's only cousin / Was the King's daughter's sibling,]] / But they're all gone,
-->'''Crowd''': So that is why
-->'''Yakko''': I am now your king!
* ''ThePiratesOfDarkWater'': Prince Ren was raised by a lighthouse keeper unaware of his true heritage until the first episode. Hiding him was proven a wise move, considering [[BigBad Bloth]] had killed Ren's father's other heirs.
[[/folder]]

[[folder: Real Life ]]
* Henry VII of the House of Tudor had a rather tenuous relationship to Henry VI of the House of Lancaster. His mother Margaret Beaufort was descended from one of John of Gaunt's legitimised out-of-wedlock sons (who were barred from the secession) and his father Edmund Tudor was of uncertain legitimacy as the timing of his parents' marriage could not be verified. He would therefore never have been considered for the throne if the more direct royal lines within the House of Lancaster had not been exterminated in the UsefulNotes/WarsOfTheRoses. One of Henry's first acts as king was to marry Elizabeth of York, uniting the House of Plantagenet's two rival cadet branches under a new dynasty of enhanced legitimacy, the House of Tudor.
* A number of imposters throughout history tried to invoke this trope by claiming to be an heir who had not been killed after all, e. g. Lambert Simnel and Perkin Warbeck during the reign of Henry VII. In Russia, the "false Dimitri" actually managed to overthrow the reign of Czar Boris Godunov. In Frnace, over a hundred men claimed to be Louis XVII, the son of Louis XVI, somehow having escaped death in the Temple during the Revolution.
* Abd al-Rahman I survived three consecutive massacres of Ummayad family members and their supporters, and kept a low profile during an epic journey west from Damascus until he arrived in the Iberian Peninsula and founded the Ummayad Caliphate of Cordoba.
[[/folder]]

----