It is well known that a classical Fubini theorem for Hausdorff dimension cannot hold; that is, the dimension of the intersections of a fixed set with a parallel family of planes do not determine the dimension of the set. Here we prove that a Fubini theorem for Hausdorff dimension does hold modulo sets that are small on all Lipschitz graphs.We say that $$G \subset {\mathbb{R}^k} \times {\mathbb{R}^n}$$ is Γk-null if for every Lipschitz function $$f:{\mathbb{R}^k} \to {\mathbb{R}^n}$$ the set $$\{t \in {\mathbb{R}^k}:(t,f(t)) \in G\} $$ has measure zero. We show that for every Borel set $$E \subset {\mathbb{R}^k} \times {\mathbb{R}^n}$$ with dim $$({\rm{pro}}{{\rm{j}}_{{\mathbb{R}^k}}}E) = k$$ there is a Γk-null subset G ⊂ E such that $$\dim (E\backslash G) = k + {\rm{ess}} - \sup (\dim {E_t})$$ where ess- sup(dim Et) is the essential supremum of the Hausdorff dimension of the vertical sections $${\{{E_t}\} _{t \in {\mathbb{R}^k}}}$$ of E.In addition, we show that, provided that E is not Γk-null, there is a Γk-null subset G ⊂ E such that for F = E G, the Fubini property holds, that is, dim (F) = k + ess-sup(dim Ft).We also obtain more general results by replacing ℝk by an Ahlfors–David regular set. Applications of our results include Fubini-type results for unions of affine subspaces, connection to the Kakeya conjecture and projection theorems.