Colonial Williamsburg, the former Virginia capital that Rockefeller money rebuilt, has returned to economic solvency after deficit-ridden years of financial uncertainty.

The restored 18th century town, regarded as Virginia's leading tourist attraction, passed the break-even point last year for the first time since at least 1970 - by a narrow $5,000 of an annual operating budget of more than $49 million. Officials say the historic community has remained in the black so far this year.

The turnabout follows a series of belt-tightening measures designed to trim costs, increase income and avoid what officials viewed as a cause for deep concern - the risk that the town might have to dip into its Rockefeller nest egg, now estimated at about $65 million, to offset the yearly deficits.

In an interview last week, Carlisle H. Humelsine, chairman and chief executive officer of the Colonial Williamsburg Foundation, said the economy moves included:

Staff cutbacks that reduced the Colonial Williamsburg payroll from nearly 3,700 employes in 1976 to about 3,300.

A temporary halt to capital spending - for reconstruction and refurbishing of historic buildings.

Price increases for admission, meals and lodging. Daily rates at the elegant Williamsburg Inn, for example , now range from $60 to $162.

A major fund-raising drive - the foundation's first systematic campaign for contributions - that has brought in about $20 million in two years.

At the same time, Humelsine said tourism has risen markedly this year - about 13 percent more in April and May than in the same months last year.

With more than 1 million sightseers every year, Colonial Williamsburg is ranked by state government officials as Virginia's "No. 1 attraction" for tourists. State Travel Service surveys in 1972, 1974 and 1977 showed Colonial Williamsburg the leading tourist site, they said.

"We today have a leaner, more efficient operation than we had before," said Humelsine, 64, a former diplomat who looks like and, by his own account, is sometimes mistaken for Bert Lance, President Carter's recently indicted former budget director.

In addition to serving as Colonial Williamsburg's chief executive officer, Humelsine is also chairman of the National Trust for Historic Preservation.

After years of coasting on its Rockefeller wealth, Colonial Williamsburg started to be battered by economic troubles during the 1970s.

Gasoline shortages led to a steep drop in tourism in 1974. The 1976 Bicentennial failed to bring an expected surge of visitors. Inflation caused multimillion-dollar deficits, including a $3 million loss in 1977. One recent winter, Humelsine said, the foundation had to borrow money to keep afloat.

This array of fiscal woes, Humelsine said, had raised the prospect that Colonial Williamsburg might have to "cannibalize" its endowment fund to cover its operating deficits. That possibility, he added, has been avoided.

The endowment, set up in 1957 with money donated by the late philanthropist John D. Rockefeller Jr., initially amounted to $55 million, Humelsine said. A 1970 financial statement listed it as nearly $58 million, and Humelsine said it has grown to between $65 million and $70 million.

The endowment fund is invested in stocks, bonds and government securities, and the interest and dividends from these investments - about $3 million annually - have been used for Colonial Williamsburg's recurrent deficits and to pay for reconstruction and restoration projects.

The rebuilding of Williamsburg, Virginia's capital from 1699 to 1780, began in 1926. Humelsine said more than $90 million has been spent since then to rehabilitate this somnolent town of colonial white-frame houses and red-brick government buildings that sprawls over more than 3,000 acres between the York and James Rivers. The property is now worth more than $300 million, he said.

Despite the foundation's current optimism, Colonial Williamsburg still faces financial uncertainties.

A key question is whether recent gasoline shortages will reduce tourism. Charles R. Longsworth, Colonial Williamsburg Foundation president, warned in a recent newsletter that "curbing weekend gasoline sales could be disastrous," especially because more than 90 percent of the town's visitors arrive by car.

Humelsine said there has been no indication that the gas crunch has cut into Williamsburg's tourist business. But tourists here repeatedly expressed doubts about the gas outlook in interviews last week.

"It was some concern whether we were going to get here or not," said John Voss, who had driven here with his wife from Michigan. "We've still got conern about getting back."

In another development that puts modern pressures on this traditionalist community, a labor organization - Local 23 of the Hotel, Restaurant and Bartenders International Union - won the right in an election this month to represent about 1,000 Colonial Williamsburg employes. Contract negotiations are expected to begin soon, with union leaders describing wages and job security as key issues.