Earworm
Etymology
A loan-translation of German “Ohrwurm” (literally "ear-worm"), which entered English in the 1980s. Researchers formalized it as "involuntary musical imagery." The German original may itself echo an old folk belence about insects crawling into ears, but the modern musical sense is 20th-century.
noun · /EER-wurm/
A catchy fragment of music that lodges in your head and repeats involuntarily.
What it names
It gives a precise handle to a near-universal experience that “stuck in my head” only gestures at, and names it as a cognitive event rather than a nuisance.
Example
That jingle became an earworm the second I heard it, and it looped in my head for the whole commute.
Related idea
Distinct from a meme, which spreads between people; an earworm replays inside one mind, though catchy songs are often both.