ALBANY, N.Y. (NEWS10)- Ever tried to apply for a loan or credit card at your bank and been told your debt-to-income ratio is too high? It’s easy to calculate but what’s the optimal debt-to-income ratio?

Knowing your debt-to-income ratio can help prevent surprises before applying for a mortgage or refinancing an existing mortgage, applying for a credit card, auto, or personal loan.

The formula to calculate the debt-to-income ratio is simple enough. Add up all monthly expenses (mortgage, car, credit card, other bills). Divide your total monthly expenses by your gross monthly income (income before taxes, and deductions), then multiply that number by 100.

Check out how the debt-to-income ratio is calculated for someone who pays out $2,000 in bills each month with a gross monthly income of $2,500 in the graphic below:

The debt-to-income in the above scenario is 80%. In other words, 80% of monthly income is spent on bills. Despite on-time payments and having a decent credit score someone with a high debt-to-income ratio is statistically more likely to default on loans or credit accounts, according to the Consumer Financial Protection Bureau (CFPB). It means they are also a risk for banks and lenders.

What’s considered a good debt-to-income ratio? Experts and financial institutions like LendingTree, CFPB, NerdWallet, Bankrate, and Wells Fargo said the ideal debt-to-income ratio is somewhere between 28-36%. It doesn’t matter how much someone’s wages are. If they pay out more than 28-36% it may be difficult to secure a loan or credit card.

Banks and/or credit card companies may also have different requirements. Smaller financial institutions may have less flexibility and require a lower ratio to secure a loan or credit card.

Going back to the above scenario, someone paying out $2,000 in bills would have to gross $5,500 a month to achieve a debt-to-income ratio of 36%. If more than doubling their income was not an option, they could achieve the same ratio with a monthly gross of $2,500 if they were able to reduce their bills to $900 a month.