Shouting "Death to the Shah" in their native Farsi language, 700 to 1,000 masked Iranian students and supporters staged a militant but orderly demonstration yesterday at the White House to protest the visit there of Iran's Empress Farah.

With banners saying "Farah Fascist Queen" and postered depicting her husband, Shah Mohammed Riza Pahlevi, as a puppet dangling on strings controlled by the CIA, the protesters noisily jammed both curbs of Pennsylvania Avenue NW on the north side of the White House and marched in serpentine loops on the sidewalk. One protestor was arrested on a charge of disorderly conduct.

It was the biggest political demonstration directed against the White House since President Carter took office last January and among the most stridently militant undertaken by the Iranian students in several years.

A sudden torrential rain drenched the protesters at 1:20 p.m. about halfway through the three-hour demonstration, but the marching and shouting continued unabated.

Meanwhile, Empress Farah lunched inside the White House with First Lady Rosalynn Carter on cold mussel soup, Swiss cheese souffle and peach melba.

"We could hear (the demonstrators) inside the White House," said Mrs. Carter's press secretary, Mary Hoyt, "but I don't think it was obvious (to Farah)."

The empress had entered the White House grounds at 12:25 p.m. by the southwest entrance, a quarter of a mile from the demonstrators. She left two hours later, according to Hoyt.

Outside, the crowd repeatedly shouted. "The Shah kills people - the people take arms" and "Stop torturing political prisoners."

"Long Live the Armed Struggle of Iranian People," said numerous posters.

A cardboard figure of the Shah showed him bespangled with medals, dollar signs, a swastika and a star of David. A flatbed truck drove slowly up and down Pennsylvania Avenue with a mock firing squad armed with wooden rifles "executing" political dissidents.

The protest is part of a concerted effort by Iranian students throughout the United States to shadow the empress during her current visit in this country.

Last week, 1,500 protestors demonstrated in New York City when she received the annual award there from the Appeal of Conscience Foundation for her efforts in raising the status of women. Demonstrators slowed traffic on Fifth Avenue and seven protesters were arrested.

"We want to show up the hypocrisy of Farah being received at the White House and receiving all these humanitarian awards in this country," said a protest leader who gave his name as Mansoor, of Chicago. "Being humanitarian is impossible in the Shah's regime."

"We oppose Farah's visit because it is just preparing the way for a visit by the Shah. It's a publicity effort," said Victoria, another organizer. "We want to offset that."

Yesterday's protesters were adherents of four Iranian student groups in the United States, one calling itself the Organization of Iranian Moslem Students and the other three being factions of the Iranian Students Association. Most wore paper masks because they say they fear reprisals if they are identified by SAVAK, the Iranian secret police apparatus.

The students represent a broad and sometimes conflicting cross-section of socialist and Marxist ideology. According to organizers, most support the two major underground political networks in Iran, the Organization of People's Majahedin and the Organization of Fadian of Iran.