MEGALOVANIA (/ ˌme.ɡəlo.ˈveɪ.niə /) is the 100th track in the Undertale Soundtrack. It is a fast-paced song which plays during the final battle against Sans on the Genocide Route.

“Megalovania” was originally composed for Toby Fox’s hack of EarthBound known as “Radiation’s Halloween Hack” which was a submission to Starmen.Net’s 2008 Halloween Funfest.

“Radiation’s Halloween Hack” was about an alternate universe of EarthBound where the chosen four never returned, or simply put “bad rom hack with swears.” According to “The Making of Radiation’s Halloween Hack,” the track “Megalomania” from Live A Live was originally planned to be used as the game’s final boss theme instead. Toby Fox never got around to it, so he “yelled whatever [he] felt like into a microphone and copied it down,” thus creating “Megalovania.” Toby Fox has also hinted that Megalovania was also inspired by the SFC/SNES version of “Gadobadorrer” from Brandish 2: The Planet Buster, where the hack’s protagonist originated from.

This song would later be reused for the webcomic Homestuck, as “MeGaLoVania” on the Homestuck Vol. 6: Heir Transparent album with guitars from Joren “Tensei” de Bruin. This version makes a brief appearance in the Trickster Mode of “[S] Past Karkat: Wake up.” and then makes a full appearance in “[S] Wake.” This track’s leitmotif can also be heard in other Homestuck songs. A few of the songs in the AlterniaBound album, such as “The Blind Prophet” by Toby Fox, “She’s a Sp8der,” and “FIDUSPAWN, GO!” all contain the leitmotif. A song in a later album, “Ascend,” also contains the leitmotif. Another version of the song by Toby Fox dubbed “Brodylovania” went unused in Homestuck’s soundtrack.

After its appearance in Undertale, a remix of the Undertale version appeared in Super Smash Bros. Ultimate as paid DLC with the Sans Outfit for $0.75 released on September 4, 2019. This version also briefly features the leitmotifs of Heartache and Bonetrousle.