President Carter plans to announce today a major expansion of federal aid to college students that is designed to benefit middle-income families and deflect pressure for a college tuition tax credit.

The president discussed both the college aid program and his stalled energy legislation with Democratic congressional leaders yesterday. Afterward, House Speaker Thomas P. (Tip) O'Neill Jr. (D Mass.) sounded optimistic on the energy issue, predicting a possible compromise on natural gas pricing "within 48 hours."

The student assistance expansion to be announced today, according to congressional sources, would add about $1 billion to the existing $4 billion a year the government now provides in grants and loans to college students and would liberalize eligibility rules so that more students could receive the aid.

Currently, students from families with incomes up to $15,000 a year are eligible for grants of up to $1,600 a year to cover college costs. The administration already has proposed that the maximum grant amount be increased to $1,800 in the fiscal year that begins Oct. 1. In addition, Carter will propose today that the family income ceiling for such grants be increased to about $25,000 a year, substantially increasing the number of students eligible for government grants.

The president will propose a similar liberalization in the government loan program to college students, under which the government guarantees and pays the interest on loans of up to a total of $7,500 for college expenses. Currently, students from families with incomes up to $25,000 a year are eligible for loans. Carter will propose that the income ceiling be raised to $45,000 a year.

The president's budget proposals for the next fiscal year included $700, 000 in contingency funds to expand the student aid programs, although the total price tag is now expected to exceed $1 billion.

White House press secretary Jody Powell, who told reporters the details of the program would be announced today, said that rapidly escalating college costs now jeopardize the ability of even middle-income families to send their children to college. College costs increased by 71 per cent between 1967 and 1975, he said.

Other White House officials said one of the main reasons the expansion is being proposed now is to cut off attempts in Congress to enact a college tuition tax credit which the administration considers too costly and inefficient. Tax experts say many of the benefits of a credit would go to upper-income persons.

Last year, an effort by Sen. William V. Roth Jr. (R-Del.) to attach a tuition tax credit rider to the Social Security bill held up passage of the Social Security measure for weeks.

Roth eventually agreed to drop the issue temporarily but has not given up hope of enacting a credit. The Roth proposal would cost the Treasury $1.3 billion a year in lost revenues. It would allow parents to reduce their federal income taxes by up to $250 for each child in college depending on tuition and other costs.

The hope for a compromise on the energy legislation is based largely on a proposal by Sen. Henry M. Jackson (D-Wash.) calling for a phased deregulation of natural gas prices over seven years. Speaker O'Neill said he thought such a compromise would be "salable" in the House, although he conceded he did not know whether the House members of the House-Senate conference committee on natural gas would accept it.

Meanwhile, a planned meeting of pro-deregulation senators to come up with a counterproposal to the Jackson plan was postponed yesterday and is now scheduled for today. The postponement was caused by bad weather in other parts of the country that prevented some of the senators from getting to Washington.

In another development yesterday, Carter began a concerted personal lobbying effort on the Panama Canal treaties in separate meetings with Sens. Ted Stevens (R-Alaska), Jennings Randolph (D-W.Va.) and Howard W. Cannon (D-Nev.).

White House officials said the president plans to meet this week with about 10 senators who are considered uncommitted or leaning against approval of the treaties as part of his personal lobbying campaign.