The manufacturer is under fire for not recalling Chevrolet Cobalts, Saturn Ions and other General Motors models over the past decade, despite its own evidence that the defects were posing a major hazard.
Thirteen deaths have been linked to the problems, and GM eventually issued mass recalls this year.
Barra said GM has acknowledged the problem, launched an exhaustive review to determine what and who is responsible, and pledged top-to-bottom changes in shifting from a "cost culture" to a focus on safety and quality.
"Today's GM will do the right thing," she told a House investigations panel in Washington.
"That begins with my sincere apologies to everyone who has been affected by this recall," she added. "I am deeply sorry."
Lawmakers pointed to internal documents showing GM at first refused to change the faulty switches because it would have been too costly.
The lawmakers, and Barra, expressed astonishment that the company went ahead with using the parts even though they did not meet GM standards.
"That is not something that I find acceptable," Barra said.
"Today... if we know there is a safety defect on our vehicles, we don't look at the cost but at the speed at which we can fix the problem."
Heaping pressure on the automaker, weeping relatives marched up Capitol Hill, clutching images of their loved ones, to demand accountability from GM and tell how their children died in vehicles they said the company knew were faulty.
Barra said she met privately today with crash victim relatives, some of whom watched her testify.
The auto giant faces mounting legal troubles, including a Justice Department probe and lawsuits from people injured and families of those who died in crashes allegedly tied to the ignition issue.
Analysts have already speculated that the trouble could cost the company billions of dollars in penalties and damages, on top of huge recall costs.
Lawmakers argued tragedy could have been avoided if GM acted swiftly to fix a serious but inexpensive problem.
"Two dollars. That's how little this ignition switch could have cost to repair," said Senator Ed Markey.
"But that was apparently $2 too much for General Motors."
Also testifying was acting administrator David Friedman of the National Highway Traffic Safety Administration, the auto safety agency under attack for not acting on its own evidence that the ignitions posed risks.
But Friedman cast blame on GM, saying the company withheld crucial data that would have triggered an in-depth probe years ago.