The average cost of tuition and fees at a public university for the 2015–16 school year was $9,410 for an in-state student and $23,898 for an out-of-state student, a yearly College Board survey found. The figure for a private nonprofit university was much higher—$32,405.

There’s good news, though: You can take steps to make college more affordable.

Use tax benefits to offset college costs

In a perfect world, families could save enough in a tax-advantaged account such as a 529 plan to cover the full cost of college. But for most, that goal is unrealistic. For 2015–2016, the average family paid $14,540, including money from parent and student income, savings, and loans. That represents 61% of the total cost of tuition, room and board, and other expenses, according to education lender Sallie Mae. The remainder came from financial aid, including scholarships and grants.

One way that families can maximize their college funds is through tax savings from a tax-efficient spending plan.

Because 529 plan assets already provide a tax benefit, dollars spent from that account won’t let you take advantage of benefits such as the American Opportunity Tax Credit. The AOTC provides a $2,500 credit on $4,000 of qualified spending. For federal tax purposes, you can use only one education credit or deduction per student in a given tax year. Keep in mind that 529 accounts may also offer a state tax benefit. Determine which benefit is most advantageous and plan your spending accordingly.

Be aware of tax implications when tapping various account types. For instance, you can withdraw tax-free from tax-advantaged accounts, such as a Roth IRA, provided the money is used for qualified higher education expenses. But spending from tax-deferred accounts, such as a 401(k) plan or a traditional IRA, can increase your taxable income.

“Be careful not to short change your retirement by dipping into your savings to pay tuition bills. You may ease your short-term financial obligations, but these actions can have long-term financial impact. As the saying goes, you can borrow for your child’s education, but you can’t borrow for your retirement,” said Charu Gross, head of Vanguard’s Education Savings Group.

Obtaining financial aid

A college education is one of the most expensive investments you’ll ever make. Fortunately, the vast majority of students receive some form of financial aid, and 70% of aid recipients get it in the form of grants and scholarships, which don’t need to be repaid.

It’s important to understand how saving and spending decisions can affect the availability and amount of aid your child receives. For example, distributions from a 529 account owned by a grandparent are considered student income and may lower aid eligibility. Likewise, 529 assets in a dependent student’s account are considered parental assets, which can also affect eligibility.

Identify the income sources and assets that most affect eligibility, and create a spending strategy that maximizes your child’s chances of obtaining aid. Consider spending any savings that your child has accumulated early on in college.

Spend strategically from your 529 college saving plan

You can maximize the benefit of your 529 college savings account by spending strategically. Understand which college expenses are eligible to be paid for with your 529 plan savings.

Start by taking inventory of your expenses and resources. Include any expected contributions from grandparents or other relatives. Consider delaying spending from tax-advantaged accounts such as your 529 plan until the student’s later years of college.

“One area where families often get tripped up is spending from a 529 owned by a grandparent or other relative,” said Jonathan Kahler, an analyst in Vanguard Investment Strategy Group. “When expenses are paid from those accounts, it’s counted as student income. Financial aid is based on the applicant’s tax returns from the prior two years, so if you hold off on spending from those accounts until the student’s final two years of college, it will no longer affect aid eligibility.”

At the same time, spreading out spending from your 529 can allow for continued tax-deferred growth, which can reduce the amount you need to borrow or to pay out of pocket. Continued contributions to your 529 during your child’s college years can also help, especially in states that offer a tax benefit on them. If you have more than one college-bound child, you can transfer unused money to another beneficiary to avoid taxes and penalties on earnings.

Although the cost of college can be intimidating, creating a tax-efficient spending plan can help ease your burden.

For more information about this topic, view this Vanguard research paper.