Van der Waals heterostructures are fabricated by layer-by-layer assembly of individual two-dimensional materials and can be used to create a wide range of electronic devices. However, current assembly techniques typically use polymeric supports, which limit the cleanliness—and thus the electronic performance—of such devices. Here, we report a polymer-free technique for assembling van der Waals heterostructures using flexible silicon nitride membranes. Eliminating the polymeric supports allows the heterostructures to be fabricated in harsher environmental conditions (incompatible with a polymer) such as at temperatures of up to 600 °C, in organic solvents and in ultra-high vacuum. The resulting heterostructures have high-quality interfaces without interlayer contamination and exhibit strong electronic and optoelectronic behaviour. We use the technique to assemble twisted-graphene heterostructures in ultra-high vacuum, resulting in a tenfold improvement in moiré superlattice homogeneity compared to conventional transfer techniques.