What is a HAT on Raspberry Pi?

If you click our links and make a purchase, we may earn an affiliate commission. Learn more

On Raspberry Pi, a HAT is basically an add-on board that fits onto the Raspberry Pi GPIO pins. HAT stands for Hardware Attached on Top.

If you look at this picture of the Sense HAT, which is one of the most popular, you can better understand where the name comes from:

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

The purpose of these HATs is to easily add extra functionality to Raspberry Pi. For example, the Sense HAT has different sensors (thermometer, hygrometer, …), a LED matrix and even a joystick on it. Other hats can add additional ports (e.g. PoE Ethernet or SATA), better components (digital audio) and things like that.

Some are used as an alternative to more complex electronic circuits because they are plug and play, automatically recognized by Raspberry Pi OS, and sometimes easier to use in programs. For example, using the Sense HAT’s temperature sensor is much easier than creating a small circuit to get it from a traditional sensor.

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now
Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

If you want a better idea of what is possible, you should definitely check out my list of the best Raspberry Pi HATs here.

And for a beginner’s tutorial, I highly recommend getting a Sense HAT and following this two-part guide:

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

Whenever you’re ready, here are other ways I can help you:

Test Your Raspberry Pi Level (Free): Not sure why everything takes so long on your Raspberry Pi? Take this free 3-minute assessment and see what’s causing the problems.

The RaspberryTips Community: Need help or want to discuss your Raspberry Pi projects with others who actually get it? Join the RaspberryTips Community and get access to private forums, exclusive lessons, and direct help.

Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.

Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.

You can also find all my recommendations for tools and hardware on this page.