We prove quadratic estimates for complex perturbations of Dirac-type operators, and thereby show that such operators have a bounded functional calculus. As an application we show that spectral projections of the Hodge--Dirac operator on compact manifolds depend analytically on \(L_\infty\) changes in the metric. We also recover a unified proof of many results in the Calder\'on program, including the Kato square root problem and the boundedness of the Cauchy operator on Lipschitz curves and surfaces.