Cap

A cap is the trademark type of garment seen in the Mario franchise. Many characters wear a cap, such as Mario, Luigi, Wario, Waluigi, Goombario, and many others.

Super Mario 64 / Super Mario 64 DS
The three power-up caps in Super Mario 64 give Mario certain special abilities: Mario's cap can be stolen by Klepto and an Ukkiki, or blown away by a Fwoosh or the giant snowman in Snowman's Land. When Mario does not have his cap and takes a hit by an enemy or a hazard, he will lose an additional health wedge to how many health wedges he will lose (for example, if Mario, without wearing his cap, takes damage from an enemy that causes him to lose two health wedges, he will lose three health wedges). When lost, Mario's cap can be found by grabbing the Ukkiki, attacking Klepto, or simply picking it up if no enemies stole it. If the cap is blown off by the Fwoosh on Tall, Tall Mountain, the player has to exit the course, return to it, and grab the Ukkiki wearing Mario's cap. This applies only to the Nintendo 64 version of this game. In the DS remake, if Mario, Luigi, or Wario loses his cap and the player exits the level, a Toad in the main lobby of the Mushroom Castle can be seen wearing it. Talking to the Toad will return the cap to the player.
 * The Wing Cap, which is basically Mario's cap but with wings, gives Mario the ability to fly.
 * The Vanish Cap, a see-through version of Mario's cap, turns Mario intangible.
 * The Metal Cap, a metal replica of Mario's cap, makes Mario metallic and invincible.

In Super Mario 64 DS, the various characters' caps appear instead and serve a new function. Grabbing a cap allows whoever possesses it to change his appearance and abilities (however, his voice will remain unchanged). If a character (besides Yoshi) loses his cap, short-fused Bob-ombs will pop out of red blocks instead of power-ups, in addition to the original game's defense penalty. If the character without his cap takes damage from an enemy or hazard that takes one health wedge, he will lose one health wedge on the first hit, then lose two health wedges on the second hit, and the process will repeat. In the early portion of the game, those kinds of caps also act as 1-UP Mushrooms. For example, if Yoshi wears Mario's cap and takes another one, he will be awarded a 1-UP. However, as Yoshi frees Mario, Luigi, and Wario, redundant caps will be replaced with ones of a different color, and it will be impossible to find two caps of the same color, except during the Bob-omb Battlefield's second mission, Footrace with Koopa the Quick, where one extra Mario Cap is still present. Yoshi can choose to wear the caps of whatever characters were rescued before entering a course. If the character, along with his own cap, is blown off, this time he will need to retrieve it from the enemy who is wearing it.

Super Mario Sunshine
In Super Mario Sunshine, the Swipin' Stu enemy can steal the Mario Cap. If Mario does not get back his cap, his energy will slowly drain until he dies, due to it being so hot (standing in the shade has no effect). Along with wearing his cap, it gains a Mario-esque mustache. This design is later used for the captured enemies in Super Mario Odyssey.

Super Mario Odyssey
In Super Mario Odyssey, Cappy can take the forms of many different caps that Mario can wear. These caps can be thrown to hit blocks and enemies, capture certain characters or objects, and be used as a temporary jumping platform for Mario (among other uses). All caps are aesthetic and have identical abilities (excluding access to certain areas).

Trivia

 * Mario was originally given a cap because it was easier to design and animate than hair.
 * The concept of Mario using a power-up to transform into other characters from Super Mario 64 DS would be revisited with Costume Mario in Super Mario Maker. However, rather than keeping Mario's voice and gaining new abilities, Costume Mario typically gains new voice clips/sound effects while keeping Super Mario's abilities, exactly opposite from the Super Mario 64 DS counterpart.