Everyone loves a good Easter egg in movies, and blink-and-you-might-miss-it celeb cameos are arguably some of the best.

Cameos range from totally random to inside jokes for long-time fans of the movie's writers or directors. It can even be a way for a famous person to poke fun at their own public persona.

Keep reading to see what familiar faces have shown up in unexpected places.

Matt Damon in "Thor: Ragnarok" surprised movie-goers when he appeared as Loki in a play during the film.

In a meta-moment, Loki decided to stage a play about his triumphs in previous "Thor" movies. The star-studded cast of this play included Luke Hemsworth as Thor, Sam Neill as Odin, and none other than Matt Damon as Loki.

How did this happen? According to "Ragnarok" director Taika Waititi, Chris Hemsworth and Damon are friends. The God of Thunder was able to pull some strings and bring Damon down to the Gold Coast of Australia during post-production.

Michael Jackson appeared in"Men in Black II" as an agent.

The director of "Men in Black II," Barry Sonnenfeld, revealed that he wanted Jackson to be in the first "Men in Black" movie as an alien (alongside famous faces George Lucas and Danny Devito), but that Jackson refused.

However, Jackson called up Sonnenfeld after seeing the first movie and asked to play a small role in the sequel — and so Jackson became an agent who negotiated a peace treaty between aliens.

Football quarterback Brett Favre, at the height of his fame, appeared as himself in "There's Something About Mary." He played one of Mary's ex-boyfriends.

"There's Something About Mary" stars Cameron Diaz as Mary, a woman who seems to make every man she meets fall in love with her — including Brett Favre. Throughout the movie, he is constantly alluded to by just the name Brett, making it all the more hilarious when the famous footballer finally shows up.

Daniel Radcliffe plays a dog walker in a movie-within-a-movie in "Trainwreck."

Radcliffe stars in "The Dogwalker," a spoof of a very bad artsy film that appears throughout 2015 rom-com "Trainwreck," starring Amy Schumer. According to Judd Apatow, the film's director, Radcliffe improvised the whole thing.

When the fake film was being shot, photos of Radcliffe walking multiple dogs went viral around the internet.

David Hasselhoff has the distinction of being the only human in "The Spongebob Movie."

Riffing off of his famous "Baywatch" role, the Hoff is spotted running along the beach in Santa Monica by Spongebob and Patrick. He then proceeds to give them a piggyback ride all the way out to Bikini Bottom. Of course, he doesn't need a boat.

Hasselhoff has fond memories of his time on the movie, and even kept a souvenir— a 12-foot, 750-pound replica of himself that was built for the movie.

Matt Damon is almost unrecognizable performing at a high school graduation party in "EuroTrip."

By the time "EuroTrip" was released in 2004, Damon had already been in Oscar-winning movies such as "Good Will Hunting" and "Saving Private Ryan." That's what makes his role in this low-budget, R-rated comedy all the more delightful. He even gets to sing!

Damon was asked about this seemingly random role during a Reddit AMA— and revealed the heartwarming reason for it.

The actor wrote, "'EuroTrip' was written by three guys I went to college with, Alec Shaffer, Jeff Berg, and Dave Mandell... [they] were making 'EuroTrip' and they said 'Will you come play this, you know, Howard Rollins kind of insane, bad version of a suburban, you know, punk band guy?' And I said 'Yea, I'm in Prague.' So I showed up and I'm sitting there, and I'm like 'I'm wearing a wig [for the other movie he was filming], just shave my head, let's just go for it.'

David Bowie plays himself as he teaches Ben Stiller and Owen Wilson's characters how to properly work the runway in "Zoolander."

A pivotal scene in 2001's "Zoolander" is when the two main characters, Derek Zoolander and Hansel, decide to see which one of them is the best model by having a "walk-off." Bowie made his cameo as the judge.

Stiller, the writer, director, and star of "Zoolander" called working with the rock legend "a high point in my career."

Channing Tatum has a very NSFW role in absurdist comedy "This Is the End."

"This Is the End," is a story about what happens to Hollywood actors when the apocalypse occurs. By the time Tatum appears as Danny McBride's sex slave the world has dissolved into total anarchy.

Seth Rogen, one of the film's writers and stars, shared how he convinced Tatum to play the role in an interview with Andy Cohen. He said that he politely emailed Tatum and explained the role, saying "The Gimp is wearing a wrestling mask, and when he pulls it up we would love nothing more than for it to be you underneath. I know this is crazy, but we really think it will get a massive laugh."

Johnny Depp reprised his star-making role of Officer Tom Hanson in the movie remake of "21 Jump Street."

"21 Jump Street" was originally a TV show in the late '80s, before it was remade into an R-rated comedy starring Channing Tatum and Jonah Hill.

According to the movie's screenwriter Michael Bacall, Depp was interested in filming a cameo in the remake, but wanted to make sure that his character had closure.

Janet Leigh popped in for a quick scene with her daughter Jamie Lee Curtis in "Halloween H20" — mother and daughter are both iconic "scream queens" respectively.

Janet Leigh is most famous for her role as Marion in "Psycho," so when her daughter Jamie Lee Curtis became famous for her role in the "Halloween" franchise, it only made sense that Leigh would have a cameo.

Eagle-eyed viewers noticed that Leigh's character drives off in a blue Ford Fairlane— the same car that her character drives in "Pyscho," down to the license plate.

Danny Pudi had a small but memorable cameo for "Community" fans in "Captain America: The Winter Soldier."

The Russo brothers, who directed "Captain America: The Winter Soldier," also used to produce the community college-based sitcom "Community." A specific character on that show, Abed (played by Danny Pudi) has a strong obsession with pop culture, and specifically Easter eggs. So it was a no-brainer for Pudi to have a short but sweet Easter egg of his own in the film.

The Russo brothers talked about their decision to include him in the movie on the Empire podcast. "Did Danny beg us to be in the movie? I think we begged him!" the brothers shared. They went on to clarify that they don't even know if the character is supposed to be Pudi, or Abed.

Neil Patrick Harris plays a fictionalized, absolutely terrible version of himself in "Harold & Kumar Go to White Castle" (and its sequels).

Before playing Barney Stinson on "How I Met You Mother," Harris was mainly known for his role as the namesake child doctor on "Doogie Howser, MD." But the raunchy, stripper-loving, drug-using alter ego he plays on "Harold & Kumar" banished all thoughts of Doogie.

Many people even credit "Harold & Kumar" for revitalizing NPH's career. Harris himself told the New York Times that at the time, "I was only getting jobs I was offered, not the ones I was auditioning for, because I had previous baggage."

Mike Tyson stole the show when he confronted the men who stole his tiger in "The Hangover"

The first hour of "The Hangover" is your typical bro-comedy film — until Mike Tyson himself shows up and demands that the "wolfpack" (Ed Helms, Zach Gafilianakis, and Bradley Cooper) return his pet tiger, which they stole. One rendition of "In The Air Tonight" later, and Tyson solidified himself as one of the best parts of the uber-successful movie.

Tyson later revealed that he was high on cocaine during filming, and that he only accepted the role to "supply his drug habit."

Glenn Close has a blink-and-you-miss-it part in "Hook" as an unrecognizable pirate.

This is Glenn Close and Steven Spielberg's only film together — but the actress had worked with star Robin Williams in the past (on the movie "The World According to Garp").

Close's small role in "Hook," a sequel to "Peter Pan," ends with her getting sent to the Boo Box (a locked box filled with scorpions).

Eminem had a tongue-in-cheek appearance in "The Interview" where he came out as gay — spoofing the long-time belief that he is homophobic.

Eminem has a long and complex history with using homophobic language in his music, but has always claimed that he himself is not a homophobe. His performance with Elton John (who is openly gay) seemed to have ended the speculation.

That is why his cameo in "The Interview" — an already controversial movie for portraying North Korean dictator Kim Jong-un and a CIA plot to assassinate him — is all the more hilarious. In the movie, Eminem comes out on national TV and states that he's been leaving clues all along.

Bill Murray just wanted to play golf in peace in "Zombieland," a movie about the zombie apocalypse.

When the zombie apocalypse descended upon Earth, all Bill Murray (who plays himself) wanted to do was continue to play golf in peace. So, he did what any resourceful person would do — he pretended to be a zombie so everyone would leave him alone.

Murray's cameo was universally praised by critics and audiences alike — Roger Ebert described the moment when Murray showed up as "the single biggest laugh I've heard this year."

Jimmy Fallon spoofed informational videos at amusement parks by filming a segment about an attraction at 'Jurassic World."

Celebrities filming spots for amusement park attractions is common (Ellen Degeneres, Daniel Radcliffe, Emma Watson, and Rupert Grint have all done it). So Jurassic World committed to authenticity when they got Jimmy Fallon, host of "The Tonight Show," to explain a bit about the attractions.

Johnny Depp has been vocal about his inspiration for Captain Jack Sparrow being Keith Richards — so of course Richards got to play his father in "Pirates of the Caribbean: At World's End."

When asked where he got his inspiration for his performance as Captain Sparrow, Depp said that "For a good portion of the time I was spending with [Richards], I was sponging as much of him as I possibly could for the character."

When The Rolling Stones rocker got wind of this, he agreed to film a cameo in "At World's End," as none other than Sparrow's father, Captain Teague. His performance was so popular that he appeared again in the next film, "Pirates of the Caribbean: On Stranger Tides."

Danny Glover appeared in "Maverick" alongside his "Lethal Weapon" co-star Mel Gibson.

When Glover showed up in "Maverick" to rob his former co-star Gibson, "Lethal Weapon" fans were delighted. The film leans into their connection — the two seem to recognize each other, the "Lethal Weapon" theme song plays during their meeting, and when Glover escapes he utters his "Lethal Weapon" character Murtagh's famous catchphrase: "I'm getting too old for this s--t."

The connection comes from the film's director, Richard Donner. He directed "Lethal Weapon," and "Maverick," among many other films.

Bruce Springsteen helps the main character in "High Fidelity" come to terms with his relationship issues.

When John Cusack's character in "High Fidelity" is wrestling with the decision to contact all his exes, he hallucinates one of his musical idols, Springsteen.

In fact, Springsteen wasn't even the first choice for the role— Bob Dylan was. But when the legendary folk musician was unable to film the part, Cusack reached out to Springsteen and asked if he'd like to appear. Springsteen asked to see the script, and agreed to the shoot the scene the next day.

Will Ferrell plays a dirtbag who still lives with his mom "Wedding Crashers."

Ferrell appears in just one scene in "Wedding Crashers," but has some of the most quoted lines from the film. He appears to be a cautionary tale — he's middle-aged, still lives with his mom, and likes to meet women by crashing funerals.

Billy Idol plays a hopeless romantic in "The Wedding Singer."

The legendary musician appears in the climactic airplane serenade scene of "The Wedding Singer," when Adam Sandler finally professes his love to Drew Barrymore.

The film is set in the '80s, so of course Idol (an '80s icon) makes perfect sense. His son actually inspired him to appear in the film— Sandler was one of his idols.

Jim Parsons is Walter the Muppet's human version in "The Muppets."

"The Muppets" has a lot of cameos, but none are as memorable as "The Big Bang Theory" star showing up during the musical number "Man or Muppet."

Parsons appears briefly as the human version of the Muppet Walter.