Following the global financial crisis, macroprudential regulators in a number of countries took actions to mitigate risks arising from stressed mortgage markets to financial and economic stability. Having disaggregated information on the stock of mortgages allows policymakers to analyse particular cohorts of the market that may be more vulnerable to stress, and model how these cohorts may evolve in the future and might affect the outlook for financial and economic stability. To this end, we produce the first ever estimate of the current stock of all regulated UK mortgages at the level of individual loans using data from the flow of new mortgages. We use loan-level information of 14 million UK mortgages at the point each loan was originated or re-mortgaged. Using a series of algorithms from Computer Science, we identify individual loans in the flow of lending that are likely to be still in the stock at different points in time. Then we estimate how key characteristics of mortgages (including borrower incomes, house prices and outstanding loan amounts) are likely to have evolved over time since origination. We validate our overall model by comparing key variables to information available from other sources that provide partial characteristics of the stock, including household surveys and regulatory returns. Our stock estimate suggests that there may have been more vulnerable borrowers in recent years than household surveys suggest. Finally, we illustrate the type of cohort analysis that can be done using the loan-level estimate.