NEW YORK, DEC. 31 -- The dollar plunged to 40-year lows against the West German mark, Japanese yen, Swiss franc and Dutch guilder today as central bank intervention failed to keep the U.S. currency from ending 1987 on a down note.

Gold prices rose about $3 an ounce.

The skidding dollar lost about 1.5 percent against some currencies today and closed out a dismal year with losses of nearly 24 percent against the yen and 15 percent to 20 percent against a variety of major European currencies.

The dollar gained in value in 1987, however, against the currencies of major trading partners such as Mexico and Brazil, and lost only slight ground against those of Canada, Hong Kong, Taiwan, South Korea and Singapore.

Currency traders said the New Year's Eve drop in the dollar was a bearish sign because it showed central banks could not support the U.S. currency even when there were very few people in the market to resist their efforts.

"Even with the central banks coming in, the market still can't support itself, and that is something scary," said James Chorek, an analyst for Money Market Services Inc. in Chicago.

Other traders said the ineffectiveness of the intervention may have been a sign that central banks were not serious about propping up the dollar, but only wanted to slow its decline.

The United States, in particular, has shown little commitment to bolstering the dollar, said Shigeru Tokunaga, vice president for foreign exchange for Fuji Bank Ltd. in New York.

The dollar's decline helps U.S. industry by lowering American products' prices compared with foreign-made products. But it threatens to increase inflation in the United States and hurt other nations that depend on exports to the United States.

The central banks of Japan, West Germany and Switzerland reportedly bought dollars today, but failed to prevent the dollar's 40-year lows against their currencies. The dollar also sank to six-year lows against the British pound, Italian lira and French franc.

European finance ministers tried last week to convince Treasury Secretary James A. Baker III to pledge an increase in U.S. interest rates if the dollar slips further. But Baker refused because of fears that higher U.S. interest rates would trigger a recession before the 1988 presidential election.

In Tokyo, where trading ends as Europe's business day begins, the dollar fell to a record low for the 11th time in 17 trading days, closing down 1.50 yen at 122.00 yen. That was 23.8 percent lower than the last trading day in 1986 and the lowest level since modern exchange rates began in the late 1940s.

Later, in London, the dollar was quoted even lower at 121.25 yen. In New York, where there was a half-day of trading, the dollar continued sinking to 121.00 yen.

One British pound cost $1.8850 in London today, almost 3 cents more expensive than Wednesday's $1.8565. The dollar has dropped 21.4 percent against the pound since Dec. 31, 1986. In New York, the pound edged higher to $1.8865.

Other dollar rates at the midday closing of trading in New York, compared with late Wednesday, included: 1.5700 West German marks, down from 1.5950; 1.2685 Swiss francs, down from 1.2905; 1.2985 Canadian dollars, down from 1.3019; 5.3230 French francs, down from 5.3995; and 1,162.50 Italian lire, down from 1,176.50.

Other late dollar rates in Europe, compared with late Wednesday, and with the percentage comparison to Dec. 31, 1986, levels in parentheses: 1.5815 West German marks, down from 1.5955 (down 17.8 percent); 1.2770 Swiss francs, down from 1.2920 (down 20.7 percent); 5.3275 French francs, down from 5.4125 (down 16.5 percent); 1.7765 Dutch guilders, down from 1.7945 (down 18.2 percent); 1,169.50 Italian lire, down from 1,178.50 (down 12.9 percent); and 1.3000 Canadian dollars, down from 1.3048 (down 5.8 percent).

Gold was higher at midday in both London and Zurich, where markets closed early for the New Year's holiday. The bid price for gold was $487 a troy ounce in both cities, compared with $484 an ounce in London on Wednesday and $484.50 in Zurich.

Earlier, in Hong Kong, gold fell 46 cents an ounce to $486.88. At the end of the trading day, gold closed at $486.20 on the Commodity Exchange in New York, up from $482.70 Wednesday.

Republic National Bank of New York said gold was bid at $486.25 a troy ounce by the end of trading, up from $483.40 late Wednesday.

Silver bullion prices rose slightly in London to $6.70 a troy ounce from Wednesday's $6.67. On New York's Comex, silver closed at $6.682 an ounce, up from $6.617 late Wednesday.