Why does prison social order vary around the world? While many of the basic characteristics of prisons are similar globally, the extent and form of informal inmate organization varies substantially. This paper develops a governance theory of prison social order. Inmates create extralegal governance institutions when official governance is insufficient. The size and demographics of the prison population explain why inmates produce extralegal governance institutions in either decentralized ways, such as ostracism, or through more centralized forms, such as gangs. Comparative analysis of Brazil,