NEW YORK (AP) _ Japan has surpassed the United States as the world's most creditworthy nation, according to a survey of international banks by a financial magazine.

Based on a scale of 0 to 100, with a zero representing nations most likely to default on their debts, those polled gave Japan the top rating of 95.7, with the United States second at 95.1, according to the semiannual survey conducted by Institutional Investor.

In the previous survey of 109 nations, the United States was ranked first, followed by Japan.

Although it labeled the acension of Japan ''a major upset,'' the magazine also stated the U.S. fall into second place ''shouldn't come as a surprise.''

''The U.S. budget deficit continues to swell while Congress dithers, the American trade imbalance gapes as wide as ever despite the tumbling dollar, and for the first time since before World War I the U.S. has turned into a debtor nation,'' Institutional Investor said.

Meanwhile Japan's ''massive trade surpluses and resulting huge capital exports have made it a formidable force in international finance in recent years,'' the magazine contended.

However, the magazine added that the Japanese rise could be short lived because of Japan's problems in dealing with the rise of the yen against the dollar, the possibility of economic recession and ''unemployment worries that the Japanese are ill-equipped to deal with.''

In the September survey, following Japan and the United States were Switzerland, third with a rating of 94.5; West Germany, 94.2; and Great Britain, 87.5.

Rounding out the top 10 were the Netherlands, 87.4; Canada, 87.1; France, 83.9; Norway, 83.5; and Austria, 83.3. The Soviet Union ranked 23rd with a 66.7 rating.

At the bottom of the heap was Uganda, in 109th place with a rating of 5.1.

Countries with high credit ratings generally can borrow money at a lower cost, that is, lower interest rates, than nations with low ratings.

The average country rating, the magazine said, was 40.1. That was down a slight 0.1 percent from six months ago, indicating that international bankers' confidence in worldwide creditworthiness had declined very slightly since the last survey in March.