Mauno Koivisto, a charismatic, antiestablishment politician credited for much of Finland's recent economic success, won an overwhelming victory today in a national election to replace the retired and revered Urho Kekkonen as the country's president.

Despite his relative inexperience in dealing with the neighboring Soviet Union, the dominant factor in Finland's foreign policy and trade, Koivisto won by what amounted to a stunning landslide in multiparty Finnish politics. His good showing made his selection by an electoral college here next week little more than a formality.

Nearly doubling his Social Democratic Party's share of the vote in the 1978 presidential and 1979 parliamentary elections, Koivisto won 145 of the 151 votes needed in the 301-member electoral college, according to final unofficial results of voting yesterday and today. Political leaders forecast tonight that he would easily pick up the rest from among electors for the other major candidates, particularly the leader of the divided Finnish Communist Party, Kalevi Kivisto.

The winner, Koivisto, who would become the first socialist and only the ninth person to serve as Finland's president in its 65 years as an independent nation, said tonight that the result and a record turnout of nearly 87 percent, showed that "our representative democracy is functioning and is very lively" following Kekkonen's quarter-century as president.

Asked about the future of Finland's foreign relations without Kekkonen's close relationships with Soviet leaders, Koivisto told foreign journalists here, "Let's say we have been able to overcome this election without much harm. Let us hope I am able to carry on our traditional policy."

Under Kekkonen and his postwar predecessor, J. K. Passikivi, that policy has been to maintain Finland as a democratic, capitalist, culturally Western nation alongside the Soviet Union, sharing a 600-mile border, without posing a threat to the Kremlin. Its cornerstones have been steadily growing trade with both the Soviet Union and Western industrialized nations and a unique neutrality based on a determined national defense and a 1948 friendship treaty with Moscow.

"At the present time, our position is quite strong and our position is recognized by other countries and governments," Koivisto said, alluding to Finland's success so far at remaining unaffected by growing East-West tensions elsewhere. "Let's say if we are able to manage our own business--and we have been able to do that--it will be a safety factor in world politics in the future."

Although his election showed "that a man from the left can be elected" president in politically cautious Finland, Koivisto said it should not be compared with the sweeping victory of France's Socialist President Francois Mitterrand, who Koivisto said, was elected "to carry out a socialist program."

Koivisto, who must give up his party affiliation when he becomes president, had already blurred his socialist political identity, according to analysts here, in his rise from labor organizer on the docks of the port of Turku, to governor of Finland's national bank and current prime minister.

A soft-spoken man of 59, Koivisto has been serving as acting president since Kekkonen was forced to retire by ill health at the age of 81 last October. Like his predecessor, Koivisto would have the power to shape Finland's foreign policy, command its armed forces, appoint top civil servants, decide who would try to form parliamentary governments, and dissolve parliament and call new elections. The president serves a six-year term; Kekkonen was reelected four times.

Koivisto's personal popularity, which appears much greater than Kekkonen's when he was first elected president in 1956 by a narrow margin, was reflected during the campaign by opinion polls showing that nearly 60 percent of the electorate, regardless of party or voting intention, wanted him to become president. Analysts and diplomats here attributed this to Koivisto's image as a self-made, straight-spoken, decisive man of independent mind who has never followed political fashion or party bosses.

Koivisto's Social Democratic electors won more than 43 percent of the vote in gaining their 145 electoral college places. Kivisto's Finnish Communist Party won 11 percent of the vote and 32 electors, the Finnish conservatives won nearly 19 percent of the vote and 58 electors, Kekkonen's old Centrist Party won 17 percent of the vote and 36 electors and the party of Swedish-speaking Finns won 2.3 percent of the vote and 11 electors.