This paper studies the optimal design of corporate taxes when firms are financially constrained. We identify a corporate taxation principle: taxes should be levied on unconstrained firms, which value resources inside the firm less than constrained firms. Under complete information, this principle fully characterizes the optimal corporate tax policy. Under incomplete information about firms’ future investment opportunities, the government uses firms’ payout decisions to elicit whether a firm is constrained or not, setting taxes accordingly. We show that a constant corporate payout tax, levied on both dividend payments and share repurchases, is optimal in static and dynamic environments. Quantitatively, we find that a revenue-neutral switch to a payout tax would increase the overall value of existing firms and new entrants by 7%.