Proposals to use a means test in Medicare and deny some or most Medicare benefits to higher income elderly persons are under study by the Reagan administration.

Sources stressed that consideration of a means test, never before applied to any major Social Security program, is only in the preliminary stage and may be junked before it gets very far. No decisions have been made, and the idea is just being weighed to see how much it could save for the $55 billion program.

But any plan to use a means test would breach the deeply embedded principle of automatic entitlement to rights earned by paying the Social Security payroll tax and would run into a firestorm of opposition. The AFL-CIO, American Association of Retired Persons and Save Our Security Coalition said yesterday that they would go all-out against the plan.

White House and Office of Management and Budget officials are aware of the potential opposition and are wary of stirring it up. But they are eager to find ways to cut the giant program, both to strengthen its shaky funding and to hold down government spending generally. Two proposals are under study:

* Setting some income cutoff for the elderly, perhaps $30,000 a year, and denying regular Medicare benefits to those over the cutoff. These people, however, would be given a new "catastrophic insurance" guarantee under which, once an individual with heavy medical bills had paid $2,500 or $3,000 out of his own pocket, the government would pay the rest.

One problem with this idea, according to a government expert, is that very few elderly people have income that high, so in order to get any real money out of this approach, the cutoff would have to be much lower than $30,000. In that case, large numbers of people of rather moderate income (instead of just a handful of wealthy) would be subjected to a means test and have large out-of-pocket medical bills.

The administration is trying to find out how low the cutoff would have to be to realize large savings. If it's too low, said one administration source, it would be both unfair and "political craziness to try to do it."

* Increasing the amount most Medicare patients must pay out-of-pocket for days in the hospital, but allowing low-income people to escape the extra charges. At present, a Medicare beneficiary pays $260 for his first day in the hospital, then gets free hospital care through the 60th day.

When Congress created Social Security in 1935, it decided against making it a charity program, said former secretary of health, education and welfare Wilbur J. Cohen, who served as research aide in 1934 to one of the chief planners of the act.

"The idea was to forestall poverty and dependency, not to take care of people by welfare after they became poor," Cohen said yesterday.

By giving people benefits to which they contribute by paying payroll taxes, and then making them automatically entitled to benefits, Social Security provides real security; having to ask for welfare and prove you need it isn't the same kind of security at all, he said.