Shadow bank market share in residential mortgage origination nearly doubled from 2007 to 2015, with particularly dramatic growth among online "fintech" lenders. We study how two forces, regulatory differences and technological advantages, contributed to this growth. Difference in difference tests exploiting geographical heterogeneity induced by four specific increases in regulatory burden-capital requirements, mortgage servicing rights, mortgage-related lawsuits, and the movement of supervision to Office of Comptroller and Currency following closure of the Office of Thrift Supervision — all reveal that traditional banks contracted in markets where they faced more regulatory constraints; shadow banks partially filled these gaps. Relative to other shadow banks, fintech lenders serve more creditworthy borrowers and are more active in the refinancing market. Fintech lenders charge a premium of 14–16 basis points and appear to provide convenience rather than cost savings to borrowers. They seem to use different information to set interest rates relative to other lenders. A quantitative model of mortgage lending suggests that regulation accounts for roughly 60% of shadow bank growth, while technology accounts for roughly 30%.