NEW YORK ( TheStreet) -- Millions of students have just begun college, meaning that millions of parents and grandparents -- and some students all on their own -- have begun paying for what can now cost more than $100,000 over the course of four years. That's a very expensive proposition, and as a result, maximizing the tax code as it relates to college costs has never been more critical. Statistics indicate that the average annual cost of an undergraduate college education -- including tuition, room and board, and books and supplies -- is $17,563 for public colleges and universities, $27,854 for private, for-profit schools, and $33,969 for private non-profit institutions. Scholarships and grants can cover some of the costs, but the majority of expenses will be "out of pocket" for most students. Many will turn to student loans to finance their education. According to the Federal Reserve Bank of New York, the amount of student loan debt among borrowers under age 30 has more than doubled since the beginning of 2005 to $292 billion and the average student loan debt has risen 56 percent to $20,835, as of the end of March of this year. Uncle Sam can offer help in paying for college via the Tax Code. The American Opportunity Credit, which is scheduled to expire at the end of 2012, could provide a college student who, at the beginning of the tax year, has not yet completed the first four years of post-secondary education (determined not by calendar year, but by the student's status of freshman, sophomore, etc.), a credit of up to $2,500, $1,000 of which may be refundable. The credit is 100% of the first $2,000 of qualified expenses and 25% of the next $2,000. In order to get the maximum credit you must have at least $4,000 in qualified expenses. The $2,500 maximum is per student and not per return. So if you have two kids in college at the same time you can get up to $5,000 from Uncle Sam. In addition to tuition and fees you can also include required course materials, which includes books, supplies and equipment needed for a course of study, whether or not the materials are purchased from the educational institution as a condition of enrollment or attendance. The phase-out range for the AOC is "modified" Adjusted Gross Income of between $80,000 and $90,000 for single taxpayers and $160,000 and $180,000 for joint filers. To qualify for the American Opportunity Credit a student must be enrolled in a post-secondary education program at an "eligible institution" that leads to a degree, a certificate or another recognized credential at least half-time for one semester during the year. An "eligible institution" is an accredited college, university, vocational school or other accredited institution able to participate in a student aid program administered by the U.S. Department of Education. The student must not have a felony conviction for possession or distribution of a controlled substance. Only the person claiming the student as a dependent can claim the credit. This can be the student if he/she is not claimed as a dependent by his/her parents or anyone else. It doesn't matter who actually pays the tuition. If the grandparents pay all the student's expenses, but the parents claim the student as a dependent, the parents get the credit.