The literature has found that the size of firms matters for innovation and productivity and, thus, for economic performance. It is therefore worth explaining why enterprises in Spain are small in international terms. Our findings indicate that the quality of the institutional environment plays a role. Specifically, this paper analyses the different channels through which the efficacy of Spanish courts may affect the size of the companies at the provincial level. Regarding the existing literature, this paper is innovative in several important respects. First, we disentangle the impact of judicial efficacy on average firm size by differentiating between the effect on the growth of incumbent firms (intensive margin) and the effect on entry and exit rates (extensive margin), finding clear evidence of the former but not of the latter. We do so by using a firm-level database of more than half a million companies and real data (not estimates) on judicial efficacy at the local level. Second, this paper is the first to analyse the relationship between firm size and the effectiveness of justice after the reform of the civil procedures in 2000. Finally, and most significantly, it is the first paper in the literature to analyse the specific impact of the various civil procedures, both at the declaratory and the executory stage. In general, we find that judicial efficacy has a positive effect on firm size, but it critically depends on the type of the procedure, something that the previous literature has overlooked. More specifically, judicial efficacy matters at the declaratory stage (e.g. when a debt is declared and recognised by a judge), while it does not have a significant impact on size at the executory stage.