We introduce L 2 -Betti numbers, as well as a general homology and cohomology theory for the standard invariants of subfactors, through the associated quasi-regular symmetric enveloping inclusion of II 1 factors. We actually develop a (co)homology theory for arbitrary quasi-regular inclusions of von Neumann algebras. For crossed products by countable groups Γ, we recover the ordinary (co)homology of Γ. For Cartan subalgebras, we recover Gaboriau's L 2 -Betti numbers for the associated equivalence relation. In this common framework, we prove that the L 2 -Betti numbers vanish for amenable inclusions and we give cohomological characterizations of property (T), the Haagerup property and amenability. We compute the L 2 -Betti numbers for the standard invariants of the Temperley-Lieb-Jones subfactors and of the Fuss-Catalan subfactors, as well as for free products and tensor products.