The kofia is a brimless cylindrical cap with a flat crown, worn by men in East Africa, especially Swahili-speaking cultures. Kofia is a Swahili word that means hat. The kofia is worn with a dashiki, a colorful African shirt which is called a kitenge shirt in some regions of East Africa. In Uganda, the kofia is worn with the kanzu on informal occasions. It is also worn in Somalia, where it is known as a "koofiyad".
Jomo Kenyatta, the first President of Kenya, was often photographed wearing a kofia. The kofia is popular in Mayotte. The traditional kofia has tiny pin holes in the cloth that allows the air to circulate. In West Africa, this cap is called a kufi.
In Zanzibar, and Northern Uganda, the Bargashia is a popular hat. This hat was named after Barghash bin Said of Zanzibar, the former Sultan of Zanzibar. Unlike the kofia, it is covered in embroidery and does not have pin holes. Like the kofia, the bargashia is worn with the kanzu. 
The fez is also worn with the kanzu and dashiki in East Africa. The East African style has a tassel that hangs from the top of the hat. The red fez was introduced into the region by the military. During British colonial rule of East Africa, the red fez was worn by a regiment called the King's African Rifles. The fez is also worn in West Africa, but the West African version has a stem on top of the hat, and no tassel.