Unless your monthly credit card payments are so high that your debt-to-income (DTI) ratio is too high, having credit card debt won't prevent you from getting a mortgage.
Banks and other mortgage lenders calculate your debt-to-income ratio by dividing your gross (pre-tax) monthly income by your monthly debt. Actually, there are two separate DTI ratios that a mortgage lender may take into account:
The front-end ratio subtracts your gross monthly income from your monthly housing expenses, which include your mortgage payment, insurance, taxes, and any homeowner association dues. Typically, you must maintain a 28 percent or lower approval rate.
The back-end ratio considers all of your debt payments, including credit card payments. You should try to keep your percentage below 36%.
The back-end DTI ratio is typically given more weight by lenders because it gives a clearer picture of your capacity to make your mortgage payment. And if it's higher than 36 percent, getting a loan will be difficult for you. In their DTI calculations, lenders occasionally fail to take almost-paid-off installment debt into account.