In ice hockey a hat trick is when a player scores three goals in a single game.

According to Henri Henri hat store, between 1950 and 1970 when there were six NHL teams, the store rewarded players who had scored three goals or more in one game at the Montreal Forum with a free hat, which brought the “Hat Trick” expression into the world of hockey. The list of winners includes the legendary players such as Stan Mikita and Bobby Hull from Chicago Black Hawks, Maurice Richard and Elmer Lach from Montreal Canadiens, Norm Ullman from Detroit Red Wings, and many others.

If a member of the home team in ice hockey scores a hat trick, fans acknowledge it by throwing their own hats from the stands onto the ice (often causing a delay in play as the hats are removed from the playing area).

The earliest account of a hat being awarded for scoring three goals is known to have occurred in Toronto when a local businessman, Sammy Taft, was approached by Chicago Black Hawks forward Alex Kaleta. According to legend, Kaleta entered Taft's shop to purchase a new hat but didn't have enough money. Taft arranged a deal with Kaleta stipulating that if Kaleta scored three goals as he played the Toronto Maple Leafs that night, he would give him a free hat. That night, on January 26, 1946, Kaleta scored four goals against the Maple Leafs and Taft made good on his offer.

While this account is credited by the Hockey Hall of Fame as the hat trick's origin in the NHL, there exists a competing story in Guelph, Ontario. In the 1950s, the Guelph Biltmore Mad Hatters of the Ontario Hockey Association (OHA), who were then a farm team of the National Hockey League (NHL)'s New York Rangers, were sponsored by Guelph-based Biltmore Hats, a leading manufacturer of hats with North American dominance. The sponsor would award any Madhatters player who scored three goals in a game with a new fedora.

The hat trick, as it is known in its current form, with hats thrown from the stands onto the ice, is said to have begun among fans in the NHL around the 1970s. Along similar lines, Florida Panthers fans celebrated goals (not just hat tricks) by throwing plastic rats onto the ice in 1996, which were then cleaned up by men dressed in Orkin exterminator outfits. The history of this goes back to an incident in December 1995, when Scott Mellanby scored what teammate John Vanbiesbrouck dubbed a "rat trick" after ridding the Panthers' locker room at Miami Arena of an unwanted rat with his stick on the same night he scored a pair of goals.[10] When Mellanby scored a hat trick in a later game some fans threw plastic rats on the ice, mimicking the octopus thrown by Detroit Red Wings fans, and the practice soon became universal for Panthers home goals. The NHL later responded by banning the throwing of objects onto the ice by fans at the cost of a penalty for the home team, but specifically allowed the traditional throwing of hats to continue. There appears to be some leeway with regards to what can be thrown onto the ice following a hat trick, as witnessed after the Nashville Predators' Paul Kariya scored a hat trick on April 18, 2006, when two catfish were thrown on the ice and no penalty was given

A natural hat trick is when a player scores three goals in succession, with no other players from either their own team, or the opposing team, scoring any goals in-between.

On October 17, 2008, Zach Harrison of the Minnesota State University Mavericks recorded a shorthanded natural hat trick against the University of North Dakota Fighting Sioux. Harrison scored the three consecutive shorthanded goals over a span of 29:54. According to the Hockey Hall of Fame, they were not sure that this feat had ever been accomplished before, and have since put Harrison's stick on display at the Hockey Hall of Fame. However, C.J. Young of Harvard is believed to have accomplished a shorthanded natural hat trick in 1988 against Dartmouth.

A player accomplishes a Gordie Howe hat trick by scoring a goal, getting an assist, and getting in a fight, all in the same game (though Howe himself only recorded two in his career). While this description has remained popular, it doesn't satisfy the conditions of a hat trick.

Mario Lemieux once accomplished what was unofficially referred to as a "Mario Lemieux hat trick" in 1993, by receiving radiation treatment for Hodgkin's lymphoma the day of the game, and then scoring a goal and an assist that night against the Philadelphia Flyers. He has also recorded a "5-goal hat trick" (or "ultimate hat trick", "quintella", "Texas Hat Trick", or "Lemieux Cycle") in which he scored in all five possible game situations in one game, on 31 December 1988, against the New Jersey Devils. He scored on a powerplay, short handed, even strength, penalty shot, and an empty net goal. Calgary Flames star Jarome Iginla came close on 23 February 2003, against the Phoenix Coyotes: he scored on a powerplay, shorthanded, even strength and an empty net goal, but Mario Lemieux is the only player to score the "quintella" in NHL history.