Everyone feels the pain at the pump as gas soars above $4 a gallon.

But it’s worse for people whose livelihood relies on racking up miles driving for Uber, Lyft and taxi companies. As independent contractors, drivers pay gas costs themselves.

“When you work as hard as we do, and then you have to drop another 100 bucks a week or more into the gas tank, it hurts,” said Steve Gregg of Antioch, who commutes to San Francisco six days a week to drive for Lyft.

Daily refills of his rented Nissan Altima, which used to cost $24 to $30, are now $40 to $50. He’s putting in longer hours in response. “I’m driving until I’m exhausted every day — pushing as close to midnight as possible,” he said.

Costly gas — above $4 per gallon in California for the first time in five years — is adding to the unrest of Uber and Lyft drivers at a critical moment for the San Francisco companies. Drivers form the backbone of the ride-hailing business, but they earn far less than most company employees — a discrepancy brought into sharp relief by the two companies’ debut on the stock market (Lyft went public last month, and Uber is expected to follow suit in May).

Whereas some employees will become overnight millionaires, at least on paper, drivers stand to receive a sum amounting to pennies per ride driven — if they receive anything at all. And some analysts say that in order for Uber and Lyft, which lost $911 million and $1.8 billion last year, respectively, to become profitable, they may have to squeeze their drivers more.

The companies recently implemented complicated rate changes in San Francisco, Los Angeles and some other cities. Drivers, who held protests about the changes last month, say the net result was less money in their pockets.

“Unilateral driver pay cuts” were the only major way both companies improved their finances recently, wrote Hubert Horan, a transportation industry analyst who says further cuts may push drivers too far.

The cost of gas could cause some drivers to bail.

“Any major price increase will prompt some drivers to either reduce their hours or stay off the road completely,” said Andy Pillsbury, vice president of SherpaShare, which helps drivers maximize income.

Both Uber and Lyft offer ways to help drivers address gas costs.

Lyft has a fuel rewards program at Shell stations, and encourages drivers to rent electric vehicles through its Express Drive rental program. Uber’s Visa debit card offers cash back on gas purchases, and the company offers in-app features to support drivers with electric vehicles.

But many drivers and their advocates say that’s woefully inadequate.

The increased gas cost plus recent price cuts by Uber and Lyft in several cities mean drivers are now being squeezed doubly, said Harry Campbell, who runs the Rideshare Guy blog and podcast.

“It’s tough when you can’t raise your rates,” he said.

The ride-hailing companies could raise rates themselves, but then they would risk losing riders.

“Uber and Lyft need to radically change their business model so the rider covers the fluctuating costs” of fuel, said Gregg, the driver from Antioch.

Both Uber and Lyft acknowledged to Wall Street that rising gas prices can hurt their bottom line.

“Factors outside of our control, such as increases in the price of gasoline, vehicles or insurance, may ... reduce the number of drivers on our platform,” Lyft wrote in the filing for its initial public offering. “Our business, financial condition and results of operations could be adversely affected.”

Uber also described the impact of rising fuel prices, as well as inflation and increased vehicle costs.

“These increased costs may cause drivers and carriers to spend less time providing services on our platform or to seek alternative sources of income,” Uber wrote in its prospectus. That “would decrease our network liquidity, which could harm our business and operating results.”

Mostafa Maklad of San Francisco has responded to the higher gas prices in two ways. He’s increased his time on the road — he put in 60 hours last week, about 10 to 15 more than usual. And he’s looking for other work.

“Everyone is super upset about the gas increase and the cuts in Uber rates,” he said. “Most drivers that I know have quit.”

Mathayo Huma, a student at Cal State East Bay who drives for Lyft, said the spike in gas prices has raised the cost of filling up his Honda Accord from about $40 to at least $65. His parents help him with rent, but he needs to pay around $525 per month for his car payment and insurance, along with food and other incidentals.

“Whenever I have to fill up with so much gas, it does cut into those two things, my car payment and my insurance,” he said.

Not surprisingly, people with less-efficient vehicles are most affected. Nationwide, about 12% of ride-hail drivers use hybrids, with 2% driving electric vehicles, according to a recent SherpaShare survey.

“Uber and Lyft could do variable pricing tied to increases in fuel prices,” said Ryan Green, CEO of Gridwise, an app that helps gig drivers work more efficiently and just started operating in San Francisco and San Jose last week. “That’s low-hanging fruit.”

When it comes to cabbies, one bright spot is that 96% of San Francisco’s fleet consists of hybrids. Still, the prices make an impact.

David Smith, a longtime taxi driver for Luxor in San Francisco, said his strategy when his tank gets low is to just fill up part way and save full top-offs for the cheapest stations.

“The gas prices are very hard on us,” he said. “It cuts right into our income.”

Chronicle staff writer Sophia Kunthara contributed to this report.

Carolyn Said is a San Francisco Chronicle staff writer. Email: csaid@sfchronicle.com Twitter: @csaid