Does a regular 401(k) loan count as debt when calculating one's Debt-to-income ratio when applying for a mortgage?
The loan is within the organization that manages the 401(k), and it does not show in any of the FICO score data.
It does, because it is a regular payment. If a lender is wise, they will view a 401K loan as riskier than other types of debt. An auto loan or credit card does not require a balloon payment when you change a job, but a 401K loan does. And people change jobs frequently.
A 401(k) loan is not considered in your DTI ratio, as your 401(k) is an asset of yours, not money on loan from another source. While incredibly unwise to take a 401(k) loan out (see second paragraph for a litany of reasons that is by no means comprehensive), It is the equivalent of "Borrowing" funds from an existing account under your control (albeit with stricter rules). 401(k) loans will, however, reduce what is considered to be your disposable income (for purposes like repaying student loans on an income based plan, and maximum mortgage size qualification).
401(k) loans are some of the singularly most expensive loans a person can take, as you lose out on not only the current interest from the account, but also potential future interest (40 years of growth compounding at an average of 7.5% post-inflation adjustment is ~$18 for every dollar loaned out). Additionally, many plans do not allow ongoing contributions with an outstanding loan (forgoing company match which is a guaranteed return of that % per dollar). In the USA, 401(k) loans must be repaid no later than 90 days from termination of employment (some plans restrict this even further, to 60 days, 30 days, or even immediately). Unexpected job loss makes this type of loan much riskier than it would seem at the outset. finally, 401(k) accounts have a maximum annual contribution limit (see IRS guidelines for the particular years limit, 2019 is $19,000 plus $10,000 catch up for those 55 years old and older) meaning that each year you do not max out, and each year that has less than optimal growth, is a year that underutilizes your 401(k) and the tax benefits it provides.
A quick search on the internet brought up several resources pointing to a 401(k) loan not impacting DTI. This being one.