A West German journalist and a counterfeit artist who dealt in Nazi artifacts were convicted of fraud today for perpetrating one of the most spectacular hoaxes of the modern era, the forgery and sale of what were supposed to be Adolf Hitler's diaries.

Reporter Gerd Heidemann and Nazi memorabilia dealer Konrad Kujau were found guilty of conspiring to defraud Stern magazine of more than $3 million for 60 volumes of bogus diaries and other documents allegedly written by the Nazi dictator.

Heidemann was sentenced to four years and eight months in prison, and Kujau was given a prison term of 4 1/2 years. Kujau's common-law wife, Edith Lieblang, received a suspended eight-month sentence. Both men were released today after their lawyers declared they would appeal the court's decision.

In his explanation of the verdict, Judge Hans-Ulrich Schroeder reserved some of his most scathing comments for the "grotesque performance" of Stern magazine and its publishing house, Gruner and Jahr. He chastised the management for pursuing a financial windfall by hawking rights to the diaries and suggested that wanton greed blinded Stern to the need to authenticate the papers.

Stern's publishers must share some of the blame for the fraud, the judge contended, because they failed to examine the fake volumes sufficiently before buying them. Lavishing vast amounts of money on the project only encouraged the two men to persist in the forgery scheme, he said.

A lingering mystery in the case is the fate of more than $1.5 million from the money Stern paid for the diaries. State prosecutor Dietrich Klein said he had proof that Heidemann kept at least $733,000 and may have acquired twice that sum. Kujau has confessed to receiving $530,000 for writing the diaries. He has charged Heidemann, who acted as intermediary, with pocketing the rest of the money.

The left-wing weekly unveiled what it called the "scoop of the century" in April 1983, proclaiming that the diaries revealed so many dramatic insights into Hitler and his conduct of the war that the history of the Third Reich would have to be rewritten.

Foreign publications began a mad scramble to secure reprint rights. London's Sunday Times paid $400,000 for British and Commonwealth rights to the material, which was examined and initially verified by the English historian Hugh Trevor-Roper, who does not read or speak German. He later said he had been misled about the origins of the documents.

Once the diaries were scrutinized by West German government experts, they were quickly unmasked as crude fakes. Laboratory tests showed they were written on postwar paper and in modern ink. The diaries also contained implausible trivia and glaring historical errors.

Throughout the trial, Kujau's lawyer, Kurt Groenewold, argued that Stern's negligence in checking the material reflected an overriding desire to expand circulation, gain large profits from resale rights and even contribute to revisionist views about Hitler and the nature of his regime. Groenewold portrayed his client as a mere accomplice who was pressured by Heidemann and Stern's large sums of money to produce more and more diaries.

Stern's editors claim they were duped by Heidemann, who told them he had tracked down the diaries in a southern village in East Germany, where a plane carrying the papers out of Hitler's Berlin bunker reportedly had crashed in the closing days of the war. Heidemann, in turn, contended that he was deceived all along by Kujau.

Heidemann was depicted by his lawyers as an inveterate collector whose trove of relics from reporting ventures included such bizarre items as Idi Amin's underpants.

The reporter testified that Kujau offered to sell him an opera purportedly written by Hitler entitled "Wieland the Blacksmith," as well as a third unpublished volume of the dictator's credo, "Mein Kampf," along with the diaries. Heidemann told the court that he contemplated suicide when he learned of the experts' judgment that the Hitler diaries were fakes.

Kujau, whose roguish humor often provoked howls of laughter when he took the witness stand, described Heidemann as a manic customer who wanted to buy Hitler's ashes when he heard a rumor that the dictator's bones were cremated. Kujau said he secured ashes of cremations from a friend who worked in a cemetery and gave them to Heidemann.

The convicted forger announced that his next project would be a book about Hitler's relations with women.