Leitmotifs

A leitmotif (/ˌlaɪtmoʊˈtiːf/) is a musical "phrase" or melody, re-used in multiple songs to associate a tune with a person, event, or place.

The extensive use of leitmotifs in Undertale 's soundtrack and other sound files helps create a nostalgic mood for the game and often evokes emotional responses in players. Toby Fox has stated that the majority of Undertale 's soundtrack was composed using reiterations of free SoundFonts and synths.

Attempts have been made at documenting all of the leitmotifs used in the game; players frequently find new connections, and it may be impossible to list them all conclusively. Every single data can be considered interpretations.

Timestamps found below are approximate to one second and are sourced from this playlist, which reflects the timing of the official soundtrack.

Once Upon a Time
This is one of the most frequently recurring melodies in the game. The original song can be divided into three sections, which together play in seventeen songs.

"A" section

 * Once Upon a Time 0:00–0:28
 * Start Menu and Menu (Full)
 * The background tracks for the Start Menu build upon one another, with five intermediate tracks between Start Menu and Menu (Full).
 * The music played in the menu at the end of a True Pacifist playthrough is a slowed rendition of Start Menu.
 * Home and Home (Music Box) 0:36–1:11
 * Hotel 0:20–0:41
 * Can You Really Call This A Hotel, I Didn't Receive A Mint On My Pillow Or Anything 0:14–0:30
 * Undertale 0:37–2:49, 3:27–4:43, 5:20–5:58
 * The Choice
 * Fallen Down (Reprise) 1:18–1:44 syncopated to 3/4
 * Hopes and Dreams 0:00–0:44
 * SAVE the World 0:00–0:20, 1:46–1:53
 * Reunited 0:43–1:43
 * Bring It In, Guys! 3:27–3:35, 3:47–4:05
 * Last Goodbye 0:23–0:27, 0:45–0:48, 0:56–1:02, 1:40–1:42, 1:52–2:02
 * Good Night

"B" section

 * Once Upon a Time 0:28–0:58
 * Home and Home (Music Box) 1:11–1:45
 * Hotel 0:41–1:22
 * Can You Really Call This A Hotel... 0:30–0:57
 * Undertale 2:49–3:27
 * Fallen Down (Reprise) 1:44–2:10 syncopated to 3/4
 * SAVE the World 0:55-1:04
 * Reunited 1:43–2:42
 * Last Goodbye 0:02–0:21, 1:08–1:29

"C" section

 * Once Upon a Time 0:58–1:29
 * Fallen Down (Reprise) 2:10–2:30 syncopated to 3/4
 * Hopes and Dreams 0:44–1:29, 1:52–2:15
 * SAVE the World 0:42–1:46
 * Final Power
 * Reunited 2:56–3:56
 * Menu (Full) 0:21 - 0:32
 * Last Goodbye 0:45–1:52 somewhat syncopated

Your Best Friend
This leitmotif occurs in at least seven songs, and one unused audio file.
 * Your Best Friend
 * Your Best Nightmare 0:54–1:26, 2:00–2:27, 3:00–3:27
 * Finale 0:00–0:40, 0:57–1:52
 * Hopes and Dreams 1:29–1:52
 * SAVE the World 0:05–0:07, 0:15-0:18, 0:26-0:29, 0:36-0:39, 1:25-1:46
 * Last Goodbye 0:29–0:32, 0:39-0:42
 * mus_toomuch (this plays after exhausting the random kill counter of an area)
 * mus_f_finale_1

You Idiot
Partition needed.
 * You Idiot
 * Premonition
 * Your Best Nightmare 0:00–0:15, 0:22–0:46, 2:29–2:49, 3:28–3:51
 * Burn in Despair! syncopated to 4/4
 * mus_f_part3

Fallen Down

 * Fallen Down
 * Empty House
 * Fallen Down (Reprise) 0:00–0:50
 * Respite 0:00-0:35
 * Bring It In, Guys! 3:35–3:45 syncopated to 4/4

The track Fallen Down in-game is played 25 cents above C# major in A440 equal-tempered tuning. The sheet music shown above is written in D major.

Heartache

 * Heartache
 * ASGORE 0:34–1:49, syncopated to 4/4
 * Fallen Down (Reprise) 0:50-1:18 syncopated

Ruins
Ruins is another common melody, appearing in at least thirteen official songs and an unused sound file.
 * Ruins
 * Snowdin Town 0:00-0:19 (debatable)
 * Dating Start! 1:31-1:56 (debatable)
 * Waterfall
 * Quiet Water 0:05–0:32
 * NGAHHH!! 0:34–1:22
 * Spear of Justice 0:36–1:52
 * An Ending
 * Don't Give Up
 * Reunited 0:00-1:43
 * Respite 0:35–1:54
 * Bring It In, Guys! 1:48–2:08
 * Battle Against a True Hero 0:00-1:35 syncopated to 4/4
 * mus_ruinspiano
 * mus_st_happytown

Anticipation
Partititon needed.
 * Anticipation (identical percussion track, but no melody)
 * This song also plays at extremely reduced speeds when battling Monster Kid, during the final encounters with Flowey in New Home, and at the end of a "Soulless" Pacifist playthrough. (This version is sometimes referred to by fans as "In My Way")
 * Enemy Approaching 0:00–0:10
 * Stronger Monsters 0:00–0:32, 0:38–1:00
 * Bring It In, Guys! 0:00–0:10

Enemy Approaching

 * Enemy Approaching
 * Ghost Fight 0:31-0:34
 * Heartache 0:54-0:58, 1:00-1:01, 1:12-1:15
 * Dogsong (has the variation of the melody)
 * A slowed version of this song plays after meeting Endogeny's sparing conditions.
 * Dummy! 2:08-2:10
 * Pathetic House 0:32-0:35
 * Temmie Village 0:11–0:16 repeating, also has the variation
 * Tem Shop, also has the variation
 * Stronger Monsters 0:00–0:32, 0:38–1:03
 * Spider Dance 0:50-0:58
 * Bring It In, Guys! 0:00–0:40
 * Dogtroid 0:07-0:34

Ghost Fight

 * Ghost Fight
 * Dummy!
 * Pathetic House
 * Spider Dance

Bassline

 * Ghost Fight
 * Dogbass
 * Dummy!

Sans
Found in five songs, one of which is never played in the game.
 * sans.
 * Snowdin Town 0:00-0:18
 * It's Raining Somewhere Else 0:19–1:18, 2:00–2:39
 * This song is played slightly slower in Sans's Room.
 * Song That Might Play When You Fight Sans 0:01–0:33
 * Bring It In, Guys! 0:43–0:46

Papyrus

 * Nyeh Heh Heh!
 * Bonetrousle
 * This song is played at an extremely reduced speed when encountering Papyrus for the last time in the Genocide Route.
 * Song That Might Play When You Fight Sans 0:33–0:58
 * Finale 0:41-0:58 (debatable)
 * Bring It In, Guys! 0:35–0:53

Snowy

 * Snowy somewhat syncopated.
 * This song plays when fighting Snowdrake's Mother. It is heavily distorted, changing pitch and speed randomly every few seconds.
 * Snowdin Town 0:19–0:56
 * Shop 0:00–0:25
 * Dating Start! 0:00–0:35, 0:37–0:54 somewhat syncopated.
 * Dating Fight! 0:00–0:13
 * Bring It In, Guys! 0:54–1:17

Snowdin Town
Partition needed.
 * Snowdin Town 0:56–1:16
 * Shop 0:25–0:50
 * Dating Start! 0:16–0:35, 0:54–1:31 somewhat syncopated.
 * Dating Fight! 0:13–0:35
 * Confession
 * Hopes and Dreams 2:15–3:01
 * Reunited 3:56–4:25
 * Bring It In, Guys! 1:17–1:29

Undyne

 * Undyne
 * Run!
 * Dating Tense! 0:17–0:25
 * NGAHHH!! 0:00–0:34, syncopated
 * Spear of Justice 0:00–0:36
 * ASGORE 2:29-2:35, syncopated to 4/4
 * Bring It In, Guys! 1:30–1:48

"A" section

 * Alphys 0:08–0:31
 * Bird That Carries You Over A Disproportionately Small Gap 0:06–0:13
 * Here We Are 0:00–1:28, syncopated to 5/4

"B" section
Partition needed.
 * Alphys 0:31–1:00
 * Here We Are 0:47–0:50 repeating
 * Battle Against a True Hero 1:36–2:36 (debatable)

"C" section
Partition needed.
 * Alphys 1:00–1:25
 * She's Playing Piano
 * Here We Are 1:28–1:50
 * But the Earth Refused to Die

Another Medium
The theme originates from the piano ostinato from Ruins.
 * Waterfall 0:00-0:27
 * Another Medium 0:00–0:51, 1:50–2:22
 * CORE 0:06–2:37
 * Death by Glamour 0:25–1:04, 1:57-2:12
 * Bring It In, Guys! 2:21–3:21
 * mus_star (debatable)

Hotland
Partition needed.
 * Another Medium 0:51–1:21, 1:50–2:14
 * CORE 0:34–1:01, 1:42–2:10
 * Bring It In, Guys! 2:44–3:07

It's Showtime!
Found in six songs and at least one other sound file.
 * It's Showtime!
 * Metal Crusher 0:04-0:19, 0:37-0:53
 * Live Report
 * Death Report
 * Hotel  0:09-1:27 (bassline)
 * Can You Really Call This a Hotel... 0:08-1:00 (bassline)
 * Death by Glamour 1:30–1:56
 * mus_tv (i.e., Papyrus's TV)

Metal Crusher

 * Metal Crusher 0:20-0:37
 * Last Episode!
 * Death by Glamour 1:04–1:30

Musical
If no other variation of the leitmotif outside of the three most evident ones can be found, it must be considered as simple variations of each other.
 * Oh! One True Love
 * Oh! Dungeon
 * For The Fans

Bergentrückung

 * Bergentrückung
 * Undertale 5:11-5:15 (debatable)
 * ASGORE 0:00–0:35, 1:25–1:32
 * Bring It In, Guys! 3:28–3:34

Determination

 * Determination
 * This song is sped up, looped, and played over itself, as Flowey laughs at the protagonist for dying to him.
 * ASGORE 1:50–2:28 syncopated to 4/4
 * mus_snoresymphony
 * mus_kingdescription

Asriel

 * Memory
 * Undertale 0:00–2:47, 3:27–6:21
 * At times, the melody is barely perceptible among overlapping music. It is heard on a guitar for most of the song, becoming hard to distinguish after 3:27. The tune switches to a more audible sample after 4:42, to a quiet background piano at the key change around 5:20, and back to the second SoundFont at 5:57.
 * The Choice (imperceptible), as it is a part of Undertale which contains the barely-audible Memory
 * Finale 0:40–0:57
 * His Theme

W.D. Gaster
Gaster's Theme is a song that only plays in the Sound Test room. The Sound Test room, in turn, is only found half the time between rooms 46 (room_tundra_3, Snowdin – Box Road) and 47 (room_tundra_3A), and only when fun = 65.

Four-tone accompaniments are fairly common; any of the following could be coincidental, making all of them speculative.In general, all Snowy and Mettaton musical rhythmics are considered as Gaster's Theme.
 * Snowdin Town 0:19-0:56
 * Shop rhythmic
 * Dating Start! and Dating Tense! rhythmics
 * Metal Crusher 0:04-1:02
 * Song That Might Play When You Fight Sans 0:10-0:17 0:26-0:33
 * Bring It In, Guys! 0:54-1:28

Minor Differences between songs

 * The Joystick Config songs – Uwa!! So Temperate♫, ...Holiday♫, and ...HEATS!!♫ – are all variations of each other.
 * Spooktune to Spookwave
 * Ghouliday to Jingle Bells
 * Sample used in Barrier is used in Amalgam
 * Sample used in Ooo is used in Waterfall (0:14 - 0:25)
 * Battle Against a True Hero 0:00–1:36 to Power of "NEO"
 * mus_smile is Muffet's laugh, sped up, reversed, and looped.
 * Multiple songs from the soundtrack use instrument samples from other games.

MEGALOVANIA
This song is part of a unique leitmotif. The melody of MEGALOVANIA is not heavily recycled inside the game; instead, this leitmotif crosses between games, appearing most notably in Toby Fox's own Earthbound Halloween Hack, the seven-year webcomic Homestuck, and in the Mother fangame Cognitive Dissonance. The song's use as a leitmotif is associated with an endgame event or boss battle, bringing a familiar sense of finality and the absolute to the games in which it is used.