President Reagan last night proposed a massive "sorting-out" of federal functions that would, by the end of the decade, give states full responsibility for funding and running almost all major domestic programs except those for the elderly.

The ambitious and elaborate scheme, outlined in the State of the Union address and further explained yesterday in a series of briefings, would be a major step toward reversing the centralization of power in the national government, a long-cherished Reagan dream.

"In a single stroke," the president said, "we will be accomplishing a realignment that will end cumbersome administration and spiraling costs at the federal level while we ensure these programs will be more responsive to both the people they are meant to help and the people who pay for them."

But the program, by itself, would offer no help in reducing the federal budget deficit. It would not begin until fiscal 1984, which starts Oct. 1, 1983, and even then, officials said, would not provide any net savings for the federal government.

It was also not clear how far the administration proposes to go to assure that benefits and services do not disappear when the states take over. Officials said they wanted to work out a flexible standard for maintaining miniumum aid to the needy, but had no formula for doing that.

They described the president's proposal as a "framework" for debate, and made it clear that they were ready to consider substantial modifications. The initial reaction in Congress and the states ranged from enthusiasm to apprehension, guaranteeing that the complex proposal will be a major center of controversy throughout the year.

The program has two main parts. The first is a $19-billion swap, in which the federal government would take over the state share of Medicaid payments for the poor, while the states take over the federal share of Aid to Families with Dependent Children (AFDC) plus the food stamp program, now all federal.

If legislation is passed this year, the swap would take place at the beginning of fiscal 1984. Medicaid costs have been rising faster than food stamp and welfare benefits. The states could find this attractive.

The second is a turnback of more than 40 federal-aid programs to states and cities, including major aid programs in transportation, community development, vocational and specialized education, feeding programs and health and social services.

The turnback also would take place in fiscal 1984 and, for the first three years, the states and communities would be guaranteed their share of a $30 billion federal trust fund to support any of these programs they chose to continue. The fund would be supported by federal excise taxes and a share of the windfall oil tax.

From 1987 to 1991 the federal government would decrease its support of these programs by 25 percent a year, by phasing out one-quarter of the taxes supporting the trust fund. By 1991 the federal support would be ended, but so would all federal excises except for 2 cents of gasoline tax to support the interstate highway system.

States and cities could move into the vacated tax fields to any extent they wished to finance the discontinued federal programs, or they could, without any further ado, let both programs and taxes vanish.

Many states already have their own excise taxes. As the federal government moved out of the excise field they could just raise these. But they do not have a windfall profits tax on oil, and would have to make up this money some other way.

While few officials had been briefed in sufficient detail to weigh the program substantively, the political reactions indicated the likelihood of a prolonged and partisan fight.

House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) said there would be full hearings on the proposal and its effects, adding, "I just don't believe, as I understand this federalization program, that we can make such a transfer."

Senate Minority Whip Alan Cranston (D-Calif.) said the president had "the federal government shirking its responsibilities," and predicted of the Medicaid-AFDC-food-stamps swap: "I don't think it will be passed by the Congress. It may get through the Republican Senate, but it won't get through the Democratic House."

On the other hand, Senate Majority Leader Howard H. Baker Jr. (R-Tenn.) said he was confident that "In every major social program, the basic essentials of food, shelter and fuel . . . the poor will be better off than the existing hodgepodge."

But another leading Republican, Sen. Robert J. Dole (R-Kan.), chairman of the Finance Committee and longtime food stamps champion, said skeptically of the stamps proposal: "It sounds good at first blush. But I'm not so certain a program that vast could be administered 50 different ways. We're having enough trouble administering it one way."

State and local officials generally seemed excited by the idea of realignment, but were wary about the financing of it.

Vermont Gov. Richard A. Snelling (R), the chairman of the National Governors Association, said, "I am more favorable than unfavorable, but I am also cautious."

Kansas State Sen. Ross Doyen (R), president of the National Council of State Legislators, called it a "genuine effort to sort out which level of government can respond to program needs," but his Democratic predecessor in the NCSL, Florida State Sen. Richard Hodes, said, "I'm excited about the fact that it's a new federalism, but I'm not sure where the money's coming from."

Bernard F. Hillenbrand, executive director of the National Association of Counties, called it "a stunning victory" for the counties. Ferd Harrison, Democratic mayor of Scotland Neck, N.C., and president of the National League of Cities, called the president's proposal "a bold and significant initative," but cautioned that "The greatest risk is that the cities will not be treated fairly or equitably by the states."

Democrats were critical. New York Gov. Hugh L. Carey said he feared the "dumping of welfare." And some Republicans also reacted cautiously. Texas Gov. Bill Clements said of the food stamps proposal especially, "I ain't going to buy a pig in a poke."

Spokesmen for beneficiary groups expressed their traditional fear that state and local governments would be less sympathetic than the federal. Robert Greenstein, former administrator of feeding programs in the Carter administration and now director of the privately funded Center on Budget and Policy Priorities here, said Reagan's proposals are "the greatest step backward in recent memory in efforts to deal with poverty."

Marian Wright Edelman of the Childrens Defense Fund said, "The president's proposals punish and hurt millions of children."

Administration officials, hoping to defuse or at least delay a partisan battle, emphasized their receptivity to suggestions and alterations in the broad Reagan design.

The president's federalism advisory committee, chaired by Sen. Paul Laxalt (R-Nev.), will meet on the issue today. A group of mayors will discuss it with the president Thursday, and Monday there will be a full-scale discussion with governors, state legislators and members of Congress.

The hope, officials said, is to find as much agreement as possible in the next several weeks and submit legislation to Congress in the spring. Officials said the administration hopes to keep the "swap" and "turnback" portions of the bill in a single bill, but conceded that that may be difficult with the range of committee jurisdictions involved in Congress.

The measure embodies one of the central tenets of Reagan's philosophy: the belief that most domestic programs can be run more efficiently by state and local governments.

During his unsuccessful 1976 bid for the presidency, he proposed $90 billion in program and revenue turnbacks, but played the idea down when President Ford attacked it as unrealistic.

The $47 billion swap and turnback package outlined yesterday is, on its face, not that large a chunk of a $783 billion budget. But the $28 billion in proposed turnbacks represent more than one-third of the federal-aid to states.

Politically, the Reagan proposal would divert the pressures of dozens of interest groups, whose expansionary dreams have encouraged ever-increasing federal budgets, from Washington to state capitols, county courthouses and city halls. Many of these groups fought hard in the past precisely to move their programs up from the state to a more sympathetic federal level, and thus may resist now.

In the swap, however, Washington would take full responsibility for Medicaid, which is the largest and fastest-growing of all the welfare programs, benefiting 21.5 million people in 1980. Reagan's acceptance of this as a federal responsibility marked a reversal of his long-standing preference for transferring all welfare programs to the state level.

Enacted in 1960 and substantially expanded in 1965, Medicaid provides medical services to low-income people, with the federal government reimbursing states for 50 to 77.5 percent of the costs.

Anyone receiving cash welfare is automatically eligible, and about 30 states provide aid also for people who lack income to meet their medical bills, even though they are above the welfare line.

The income standards and benefits vary enormously from state to state, with half the program outlays in New York, California and a handful of other industrial states.

An unanswered question yesterday, and one that is sure to provide a focus of debate, is where those standards and benefits would be set if Medicaid became a federal program.

Presumably, the national standards would reduce benefits for people in high-benefit states and improve them for those on the bottom of the scale, but officials said the question of standards was one that is yet to be determined.

In fiscal 1982, the federal government reimbursed the states for $18.3 billion of the total $32.6 billion in Medicaid costs, much of it for long-term nursing-home care for elderly and disabled poor people.

Under existing law the federal costs are projected to rise from $19 billion in 1984 to $25 billion in 1987. But officials said that if Medicaid were linked to Medicare--the Social Security medical program which is mainly for the elderly--at the federal level, cost-controls and program efficiencies could hold down that projected growth.

From the viewpoint of states, shifting the cost of the fastest-growing welfare program to Washington is a very tempting feature of the Reagan proposal.

AFDC and food stamps, the two programs the states would take over as their part of the swap, are older welfare programs whose rates of growth do not match Medicaid's.

AFDC was part of the original Social Security Act of 1935. The federal share is much the same as under Medicaid, with the largest percentage subsidy going to the poorest states. Current state benefits for a low-income family of four range from $120 a month in Mississippi and $140 in Texas to $563 in California and $569 in Oregon.

The food-stamp program began in the early 1960s, and expanded in the next decade to a 1982 outlay of $11.3 billion for aid to 22 million recipients, 90 percent of them poverty-stricken families.

Now the second largest welfare program, it is run by the states but financed by the federal government, which has begun trimming the number of eligibles.

Because of the generous Medicaid programs they have run, California and the liberal northern states like New York, Connecticut, Illinois, Massachusetts and Wisconsin would appear to be big winners in the swap.

New York, for example, traditionally has spent three times the national average for Medicaid, but only slightly above the national average for food stamps.

Southern states have tended to spend far less than the national average for Medicaid and AFDC, but the federal costs for food stamps in these states generally have run well above the national averages.

The turnback program is far less fixed in its details than the swap. Officials said about 80 federal-aid programs had been examined during the last three months, and that the 40 or so that survived in yesterday's presentation are sure to be modified in the weeks ahead.

Officials said the goal is to find a mix that "reduced the number of winners and losers" among the 50 states as they shifted from the current system to the proposed new one. Some states would lose a lot by discontinuing non-interstate highway aid, for example, while others would feel disproportionate impact from the termination of fuel-assistance for the needy.

There could also be winners and losers among cities in the shift. Some cities have been much more aggressive and successful than others in seeking funds for housing rehabilitation, downtown development and similar projects.

Under the administration plan, states would be required to pass through to their cities, on a revenue-sharing formula, funds equivalent to those of the discontinued federal urban programs. But no city would be guaranteed against a loss.

The programs tentatively ticketed for extinction at the federal level include aid to airports, local mass transit and non-interstate highway aid; sewer and water-treatment grants; urban development action grants and community development block grants; vocational education, training and employment and state education block grants; health, social services and community services block grants; child nutrition, fuel assistance and most categorical social service programs and general revenue-sharing with the cities.

When the turnback of these programs begins in 1984, a $30 billion trust fund would be created, with $16.7 billion coming from the windfall profits tax on decontrolled oil and the remainder coming from existing federal excise taxes on tobacco, alcoholic beverages, gasoline and telephone service.

That fund would be replenished at the same level until 1987, not rising with inflation but satisfying a demand from the governors that their grant-in-aid programs not take the brunt of the cuts every year, as they did in 1981. States would draw from the trust fund according to their 1979-82 share of all the discontinued programs.

Existing federal aid programs would be maintained through 1987. In the 1984-87 period, each state, by action of its governor and legislature, in consultation with other interests, would have the option of staying in or dropping out of each federal program. If it dropped out, it could use its money as "super revenue-sharing" for any purpose, without federal restriction.

Officials said they expect that most states would seize the flexibility and drop out of the federal-aid programs before their official expiration at the end of the decade.

Starting in 1987, the trust fund would be decreased by 25 percent each year, as federal excise and oil windfall taxes decline proportionately, reaching the point that a 2-cent gasoline tax would be left for the interstate highways.

Each state would then have the option of raising its taxes enough to make up for its share of the vanished $28 billion trust fund. Officials pointed out that a state takeover of the expiring federal excises would yield less than half that amount, and that other state taxes would have to be raised to compensate for the scheduled phaseout of the oil windfall profits tax. That tax would be allowed to die in 1991 as provided in the original legislation.

Just as there are wide variations among states in their Medicaid and AFDC standards and payments, so are there big differences in their excise tax raising. In general, fast-growing states and states with tourist economies tend to do better. Nevada's per-capita take is three times the national average, for example, while Utah's is half the national average.

The disparities issue, along with the unsettled maintenance-of-effort question, are expected to be at the center of discussion with the meetings beginning today.

Administration officials emphasized, however, that the president decided to push for a bold initiative of large dimensions, before these questions were settled, to force the federalism issue onto the congressional and political agenda.

In 1981, while Reagan had almost complete success in his budget-cutting proposals, Congress gave him only a fraction of what he wanted in increased flexibility for states and cities, through conversion from categorical to block grants. As a result the Reagan program has been drawing increased criticism from state and local officials.

Governors have advocated a different kind of "sorting-out" from the kind Reagan is proposing. But administration officials said they thought there were enough elements of the governors' proposal to make it a matter of negotiation.