Between 20,000 and 30,000 government workers a year could lose out on what are now automatic longevity raises under a controversial performance-based ratfing plan that the Reagan administrarion intends to begin in July.

Under current law 99 percent of all white-collar U.S. workers get step increases when they have enough time in grade. The raises come due every one, two and three years, and are worth 3 percent. They are awarded in addition to the annual federal pay raise.

Officials say that the new rating system would reduce the number of workers who get step increases to about 96 percent of the white-collar work force. The pay-for-performance system would also revamp the checklist Uncle Sam uses to decide who stays and who gets fired when agencies are undergoing reductions-in-force.

About 2,900 Washington-area employes were fired for economy reasons or because of reorganizations during the first three years of the administration. Officials say they do not expect major RIFs next year, but would like to have a system in place that gives greater job protection to employes based on their performances rather than their seniority.

Most civil service grades have 10 longevity steps. And most employes get a step raise when they have enough time in grade because most are rated "satisfactory" or better.

The proposed changes would set up a five-tier performance rating system for all white-collar employes. Current agency performance rating systems range from three-tier to six-tier systems. The majority of employes now get step increases based on seniority because the law requires them to maintain only "an acceptable level of competence." The new rating system, officials say, would grade performance a little more strictly.

Under the RIF changes, employes in agencies undergoing cutbacks would be grouped according to points they earned for their three most recent performance ratings, ranging from 10 points for each outstanding rating to five points for a fully successful rating.

Those points would be added to their years of service -- one point for each year -- and workers with the lowest point totals would be fired first. The current system gives almost no credit for performance and bases retention rights on seniority. Veterans would continue to have greater job security than nonveterans.

The system would be extended down to Grade 11 the first year, to Grade 6 the following year and to Grade 1 in the third year.

Federal unions oppose the performance and RIF rules changes. They say the system could be used by bosses to deny step increases to employes for political or personal reasons by giving them poor ratings even if their work is good. Because of union opposition, Congress has blocked the changes from going into effect several times. The current ban expires in mid-1985. Congress could block the rules changes again, but the administration is prepared to start the program in July.