The federal government, which has 2.8 million persons on its official civilian payroll, actually pays the salaries of at least 3 million to 4 million more, according to data gathered by The Washington Post.

The additional workers' salaries are paid indirectly through government contracts, research grants and matching payments for the wages of local government officials.

The federal government has only the vaguest idea of exactly how many such workers there are but, taken together, the figures mean that 6 million or 7 million workers are directly dependent on Uncle Sam for their paychecks.

These figures do not include the approximately 50 million people being supported by federal welfare, Social Security, pensions or public service job programs. They include only those performing some service for which the government is footing the bill.

The extent of these outside programs was underlined recently when Health, Education and Welfare Secretary Joseph A. Califano Jr. reported to the Senate Appropriations Committee that in addition to the 144,256 regular HEW employes the department is paying the salaries of 980,217 people who work for private "think tanks," universities, state and local government agencies and the like.

"Paid for out of federal funds?" asked an incredulous Sen. Thomas F. Eagleton (D-Mo.).

"That is the point," answered Califano.

Committee Chairman Warren G. Magnuson (D-Wash.), staring at Califano in astonishment, declared, "This is the best public service job program I have ever heard of."

Sen. Ernest F. Hollings (D-S.C.), adding the 144,256 direct HEW employes to the 980,217 figure cited by Califano, shot out, "My God, we are over 1 million."

Experts said later that these 980.217 HEW-funded "outside-the-walls" jobs average "somewhere between $10,000 to $20,000 each" in annual salary.

The Defense Department, which has 1 million civilians (and 2,049.000 military personnel) directly on its payroll, estimated that an added 2,050,000 people "outside the walls" receive salaries funded by DOD through research and service contracts and DOD procurement and construction activities.

Most other federal agencies didn't have similar precise figures worked out, but conceded that research contracts and grants help finance the salaries of hundreds of thousands of persons not directly employed by the departments.

A source at the Department of Housing and Urban Development took a "top of the head" guess that the figure for HUD would be at least 100,000. The Department of Energy said that 104,000 persons employed by outside contractors run government laboratories such as Argonne and Oak Ridge, and that "a whole bunch more" people are employed by contractors performing other services or research for DOE but that the exact number isn't known.

The Labor Department said it funds the salaries of 135,000 persons employed in administrative and related jobs by state and local government agencies - about three-quarters of them work in state employment services for which the United States pays 100 percent of costs.

These figures illustrate how the federal government, without appearing to be enlarging its labor force, is actually swelling the rolls of those dependent on it for jobs and is obtaining extra services without officially adding to its payrolls.

"They are shipping the money out through the state and local government and private research firms and having the work done there," a Senate Appropriations aide said.

A breakdown provided by Califano of the 980,217 figure illustrates how this is done.

His figures show that 87,777 persons in universities and 32,383 in nonprofit research institutions, plus 113,919 at private businesses had their entire salaries financed by HEW research grants, research contracts and service contracts.

The biggest share of these were medical researchers to whom the National Institutes of Health pumped out $1.4 billion in research contracts and grants in fiscal 1977.

But this group also included employes of "think tanks" like the Urban Institute and the Rand Corp., which received federal grants or contracts to perform social sciences research. These two organizations and dozens of others get the vast bulk of their income from HEW, HUD and other federal research contracts, and they employ thousands of persons.

This is also the case with the Medicare program, in which the federal government pays Blue Cross/Blue Shield and other nonfederal health groups to help run the program. HEW said that 26,537 persons in Blue Cross/Blue Shield and similar groups acting as Medicare "intermediaries" were paid with money from HEW.

A huge bloc of state and local government officials and private individuals under state and local contracts have their salaries funded by HEW through grants specifically designated to cover such salaries. For example, the United States helps the states pay for personnel to administer the local welfare and Medicare programs. Califano said HEW payments for this purpose cover the salaries of about 160,000 persons on state and local payrolls on a full-year basis.

Moreover, Califano reported, it gave states and local governments and other entities the money to pay the salaries of about 350,000 teachers and educational administrators and well over 100,000 social workers and other personnel in child care, child welfare and related childrens' services.

It all these cases, HEW doesn't pay the salary directly. It simply gives the money to various research organizations and to state and local agencies and they in turn pay salaries for the services HEW wants financed. Technically, these people aren't HEW employes, but in reality, HEW is buying their services.

The swelling tide of federal money helps explain the apparent slow growth of federal employment and the skyrocketing growth of state and local government payrolls.

Federal civilian payrolls rose from 2.1 million in 1950 to only 2.8 million persons in 1978 - a jump of about a third. But state and local-government payrolls, fueled by federal money, tripled to over 12 million persons in the same period.