It is often argued that informal labor markets in developing countries promote growth by reducing the impact of regulation. On the other hand informality may reduce the amount of social protection offered to workers. We extend the wage-posting framework of Burdett and Mortensen (1998) to allow heterogeneous firms to decide whether to locate in the formal or the informal sector, as well as set wages. Workers engage in both off the job and on the job search. We estimate the model using Brazilian micro data and evaluate the labor market and welfare effects of policies towards informality.