We introduce a novel empirical strategy to measure the size of credit shocks. Theoretically, we show that credit shocks reduce the value of long-term relative to short-term investments. Empirically, we can therefore compare the reduction of long-term relative to short-term investments within firms, allowing for firm-times-year fixed effects. Using Spanish firm-level data, we estimate the credit crunch to be equivalent to an additional tax rate of around 11% on the longest-lived capital. To pin down credit constraints as the underlying cause, we apply triple-differences strategies using foreign ownership or precrisis debt maturity.