The cohesin complex topologically encircles DNA to promote sister chromatid cohesion. Alternatively, cohesin extrudes DNA loops, thought to reflect chromatin domain formation. Here, we propose a structure-based model explaining both activities. ATP and DNA binding promote cohesin conformational changes that guide DNA through a kleisin N-gate into a DNA gripping state. Two HEAT-repeat DNA binding modules, associated with cohesin's heads and hinge, are now juxtaposed. Gripping state disassembly, following ATP hydrolysis, triggers unidirectional hinge module movement, which completes topological DNA entry by directing DNA through the ATPase head gate. If head gate passage fails, hinge module motion creates a Brownian ratchet that, instead, drives loop extrusion. Molecular-mechanical simulations of gripping state formation and resolution cycles recapitulate experimentally observed DNA loop extrusion characteristics. Our model extends to asymmetric and symmetric loop extrusion, as well as z-loop formation. Loop extrusion by biased Brownian motion has important implications for chromosomal cohesin function.