There are mortgages for people with bad credit. But if you have bad credit you may be required to make a larger down payment and the lender may charge you higher interest rates. It is sometimes easier to qualify for a mortgage than for a credit card, but before buying a house with bad credit, it would be wise to make every effort to improve your credit score.
