The federal government not only is the nation's biggest spender, it also is the biggest borrower and the biggest lender.

The government's tangled and already massive presence in the nation's financial markets promises to get even bigger in the months to come.

If all the government did was borrow enough money to make up the difference between what it will collect in revenues and what it will spend, the federal role in credit markets would be overwhelming.

In the message he sent Congress yesterday, President Carter estimated that the deficit in the federal budget will be $61 billion in fiscal 1979 (which starts Oct. 1, 1978).

The deficit is expected to total $62 billion in the current year, fiscal 1978, and was $45 billion in fiscal 1977.

The government does more than borrow to finance its overspending. It will borrow billions of dollars for programs and agencies that do not show up on the budget. These so-called off-budget agencies will borrow another $12 billion, which means the government will borrow $73 billion from the public.

In addition, agencies such as the Federal Home Loan Banks will borrow another $13.7 billion, the budget estimates. These so-called intermediaries are government sponsored but privately owned, and they borrow from the general market to redirect funds mainly to housing, but also to agriculture and education.

On the other side of the ledger, the government will become involved in $55.4 billion of loans either as guarantor or lender.

The large and continuing budget deficits and the large amounts of federal borrowing they cause worry many economists, who foresee rising interest rates and what former Treasury Secretary William E. Simon calls "crowding out."

Crowding out means that companies needing funds cannot get them because the federal government - always the best risk - takes up too much of the money available for leading.

Henry Kaufman, chief economist for the investment banking firm of Salomon Brothers, is worried that the huge volume of federal lending will have adverse impacts on private borrowing - especially for housing and businesses.

He said strong federal demand for funds will push up interest rates.

Edward P. Snyder, top debt analyst for the Treasury Department, said conventional analysis does point to rising interest rates as a result of the big budget deficits.

"I wish the deficit were smaller, it will not be all that easy to finance," Snyder said, "but I'm not at all sure that conventional anaylsis is correct when it comes to interest rates."

Snyder said there is a case to be made that, if inflation is restrained, long-term interest rates will come down, which will take pressure off short-term rates. He said the growth of the economy, international dollar developments and what monetary policy the Federal Reserve Board adopts all will be critical to what happens to interest rates.

"It's hard to know what to predict," Snyder said.

For its part, the President's budget neither predicts interest rates nor what share of the total demand for credit the administration thinks federal borrowing will account for.

In fiscal 1977 - the last year for which complete data is available - federal borrowing accounted for 24.9 percent of all the money borrowed in the nation. In 1976, when borrowing was low and antirecession spending was high, federal borrowing was 40.2 per cent.

Of the $317.5 billion that was borrowed in fiscal 1977, $78.9 billion was borrowed under federal auspiecs. The same amount of money was lent that year (borrowing and lending being opposite sides of the same transaction) and $36.6 billion, 11.5 percent, was done with federal participation as either guarantor or lender.

In the current fiscal year, which expires Sept. 30, federal lending activity is expected to grow sharply, to $51.8 billion. It will grow to $55.4 billion in fiscal 1979. The budget message does not estimate total lending for 1978 or 1979 so it cannot estimate the U.S. role.

The budget message noted that "federal lending and federal loan guarantees are a large and growing means of meeting objectives of federal programs." Guaranteed loans outstanding are expected to total $300 billion by the end of 1979.

The administration plans to propose ways to gain better control over its credit programs. It said there now is "no systematic mechanism in the government for regularly reviewing federal credit activity."

The controls the administration expects to propose will include annual ceilings on loans and loan guarantees.

Borrowing by the Treasury to support day-to-day federal operations as well as borrowing by the off-budget federal agencies - which will total $73 billion next year - are subject to a congressional debt limit.

Other borrowings, by the government-sponsored intermediaries, for example, are not.

At the end of 1979, the total amount of debt outstanding subject to the debt limit will be $690.8 billion. The interest on the federal debt is expected to be $49 billion next year, or nearly 10 per cent of the President's $500 billion budget.