This paper studies the impacts of state level residential building codes on per capita residential electricity consumption. We construct a timeline of when individual states first implemented residential building codes. Using panel data for 48 US states from 1970-2006, we exploit the temporal and spatial variation of building code implementation and issuance of building permits to identify the effect of the regulation on residential electricity consumption. Controlling for the effect of prices, income, and weather, we show that states that adopted building codes followed by a significant amount of new construction have experienced detectable decreases in per capita residential electricity consumption--ranging from 0.3-5% in the year 2006. Estimates are larger in states where codes are more stringent and more strictly enforced.