By subway and automobile, in vans and campers, on motorcycles and bicycles, roller skates and skateboards, on foot, on crutches and in wheelchairs, they came. In a dozen different ways, nearly a half-million Washington-area residents and tourists thronged in a swarm of celebrating humanity to yesterday's Fourth of July festivities and sizzling display of fireworks in the capital.

Nearly 200,000 people were on the Washington Monument grounds at 5 p.m. as the Beach Boys sent them rocking and swaying in a joyous confusion of flying Frisbees, bouncing soceer balls and foaming beer bottles.By 9:15 p.m., U.S. Park Police said the crowd on the Mall had grown to 425,000 people to see the city's skies explode into pyrtechnic confetti.

The brilliant colors and shimmering lights climaxed at 9:41, leaving the massive crowd howling and clapping with delight. Most of the people made a quick and orderly exit in cars and to the Metro subways and buses.

Metro officials reported "very, very heavy traffic" at the Smithsonian and Capitol South stations. At the Smithsonian station, approximately 5,000 people surrounded the entrance, where they were directed down in groups of 200 by U.S. Park Police with bullhorns.

Despite previous warnings about congestion, many people were also exiting at the Smithsonian stop, where trains arrived less than a half-minute apart. Many people became tired of waiting and began walking to Metro Center several blocks away, leaving mostly those with children behind.

Earlier yesterday, in relatively dry, 90-degree sunshine and fanned by gentle northwesterly breezes, the often bare-chested, sandal-wearing, and good-natured crowds took advantage of the day to wade in the Reflecting Pool, listen to the Beach Boys concert, smoke marijuana in front of the White House and paddle lazily across the Tidal Basin.

With the exception of a few dissenting voices from the pot smokers in Lafayette Square and the occasional roar of jets screaming overhead, it was a day marked by laughter, music and picnics on the grass, by couples walking arm-in-arm along the Monument grounds and friends lugging coolers in raucous laughter on America's 204th birthday.

Thousands of automobiles jammed the streets leading to the Mall. Vehicles of all descriptions were crammed into parking places on and off the pavement.

Balloons of red, white and blue danced in the breeze. The charcoal scent of flaming barbecues wafted over tree-shaded parks to entice motorists stuck in traffic.

From the Lincoln Memorial, where spectators had already staked out choice positions for viewing the evening's fireworks and celebrants unclothed liberally to wade in the Reflecting Pool, the scene was a pointillist's dream.

Beer and other spirits flowed freely. Groups of more than 200 waited in line for their turn at scores of portable toilets in the area.

Fifteen people were treated for drug overdoses, according to reports. Another 30 suffered cut feet, and 15 sought shelter under Red Cross tents, suffering from sunburn or heat exhaustion. Between 50 and 60 persons, mostly children, were reported lost.

"Washington is the best place in the country for the Fourth of July," said Jim Smith, a Department of Transportation official who rode his 10-speed bicycle to the Jefferson Memorial. "We deserved this weather this year."

One group of persons kept busy last night was the D.C. Fire Department which reported responding to 75 minor fires -- many caused by fire crackers -- from 11 p.m. unitl 1 a.m. A normal night has usually half that many, officials said.

Elsewhere in the country, steamboats raced up the Mississippi in an annual Independence Day contest. The Boston Pops Orchestra prepared for its first Fourth of July concert without Arthur Fiedler in 50 years. Cleveland residents honored the American hostages held in Iran by planting 53 trees.

Celebrants in Williamsburg read the Declaration of Independence and rang Virginia's Liberty Bell.

In Washington, the free concert by the Beach Boys fulfilled its promise of drawing thousands of eager rock fans, young and old.

At 4 p.m., the Beach Boys began pumping out old favorites from a massive, blue wrought-iron stage, blasting the music from stacks of amplifiers so powerful that their California sounds could be heard more than three blocks away.

The day proved a cornucopia of commemorations.

At the Jefferson Memorial, for instance, where teen-agers tossed baseballs and parents munched on barbecued ribs amid the clatter of transistor radios and police sirens, pianist Marden Abadi played Chopin on a grand piano before the crowds.

Earlier, about 300 members of Washington's American Muslim Mission marched from their place of worship to picnic and pray on the Mall.

Rows of men wearing loose, white high-collared garb and skull caps knelt on prayer rugs and later heard black leaders voice unity with other Americans. o

"It's good to have prayers here to show that our way of life does not contradict the basic good principles of American life," said Imam Khalil Abdel Alim. "We can identify with them and work to reestablish them."

A few blocks away, in Franklin Park at 14th and K streets NW, the Community for Creative Non-Violence served hot dogs, chicken wings and potato salad to about 500 of Washington's "street people."

The group also collected signatures on a petition addressed to Mayor Marion Barry and President Jimmy Carter, voicing disapproval of the way the city's poor are treated by the government.

In a larger gathering of dissenting voices, an estimated 2,000 people converged on Lafayette Square in front of the White House for the 13th-annual marijuana smoke-in and protest sponsored by the Coalition for the Abolition of Marijuana Prohibition.

In a free-swinging event led by Yippies and other dissidents, the whiff of protest in the air was as strong as the odor of marijuana.

Many came with flags -- both to wave and to wear. A number of T-shirts in the crowd bore unflattering slogans directed at Iran's Ayatollah Khomeini.

In one of the day's few unruly incidents, a brief melee broke out when about 100 pot smokers attempted to push out of the park several members of the Revolutionary Communist Party who were selling red flags and copies of the party newspaper.

One group chased out four in the Communist group, then set fire to a stack of their newspapers and a flag.

Most marijuana celebrants, however, chose simply to indulge themselves in the public disregard of the city's drug laws. Police have traditionally winked at their defiance. Only one arrest was reported during the day -- a man charged with urinating in public.

Elsewhere, the massive crowds on the Mall seemed to ride on a flood of good spirits. "Nobody's antagonizing anyone," said U.S. Park Police Officer Pat O'Brien, stationed at the foot of the Washington Monument. "There are no demonstrations, so I don't mind being hot and tired so much.

"Other years I've been in helmets," said O'Brien. "Today, I'm wearing this," and he pointed to his short blue cap.

At the conclusion of the Beach Boys concert in the late afternoon, thousands left the grounds, flooding into walkways along Constitution and Independence avenues and bringing automobile traffice to a virtual halt.

Many of the concert-goers set off firecrackers and shouted their approval.

Most seemed to agree with one blond youth who exclaimed, "It's one hell of a party."