A debt-to-income ratio compares the debt payments you are required to make each month against your gross monthly income, expressed as a percentage. It is the standard measure of borrowing capacity, and it answers a different question from a credit score: the score estimates how reliably you have repaid what you already owe, while the ratio estimates how much room your income leaves for another payment. A lender ordinarily wants both, because a spotless payment record on an income already fully committed is not evidence that another loan will be affordable.
In the mortgage context it is a defined regulatory term. Regulation Z, which implements the ability-to-repay requirements, sets out what belongs in each half. Total monthly debt obligations covers the payment on the loan being applied for, any simultaneous loan, mortgage-related obligations such as property taxes, insurance premiums and association dues, and current debt obligations together with alimony and child support. Total monthly income means current or reasonably expected income, including income from assets. Note what is absent from the numerator: the regulation counts obligations you are contractually required to pay, so groceries, utilities, fuel, childcare, non-escrowed insurance, retirement contributions and everything discretionary are excluded even though they come out of the same paycheck.
One naming point matters, because two different ratios travel under one label. The regulation defines a single total ratio. The mortgage industry, separately and informally, distinguishes a front-end ratio, which counts only the housing payment against income, from a back-end ratio, which counts all required debt payments including housing. Neither of those terms appears in the regulation, so when a figure is quoted without saying which one it is, the question is worth asking.