A mechanic leaning into an engine bay

P0171 Code: The Correction Ran Out, Not the Fuel

A P0171 code doesn't mean the engine is starved. It means the computer used up its room to correct, and where that happened tells you where to look.

Iqbal TaherWritten byIqbal Taher

Photo: Mathias Reding · Pexels

Built from4 sources
Last verified

Last verified

What this date means

The day somebody went back and checked the facts on this page: the prices, the documents, the intervals. It isn't the day the page was last edited. Turning a paragraph into a list doesn't move this date; re-reading a source does.

Short answer

A vacuum leak, or fuel that never arrived

P0171 means long term fuel trim reached its limit while adding fuel on bank 1: air is getting in that was never measured, or fuel isn't arriving that should be. When the problem is worst tells you which: bad at idle points at air, bad under load points at fuel. The three repairs behind it average $287, $346 and $1,511 in the US, and you pay one of them.

OilAndMiles.com - A P0171 code is an OBD-II code filed under "system too lean", and that phrasing sends people looking for a fuel supply problem. It's the wrong first move about half the time. The right one is reading every code stored, because what sits beside this one narrows it fast.

The code isn't a measurement of how much fuel the engine got; it's the computer announcing that it has been quietly adding fuel and has now run out of room to add any more. That distinction matters because the two most common causes pull in opposite directions: air arriving that nobody measured makes the mixture thin, and fuel failing to arrive does the same thing from the other end. Both set the same code, and the cheapest way to tell them apart costs nothing: notice when it's worst.

This page covers P0171 and P0174 together with their rich counterparts, P0172 and P0175, because they're one system read in two directions. Splitting them would mean writing the same explanation twice with the sign reversed.

Air inMass air flow sensorThe air is counted hereUnmetered airA split hose, past the countEngineExhaustOxygen sensorWhat was left over is read hereEngine computerIt adds fuel to match what it reads,until it has no room left. Then P0171The air is counted at one end. The verdict is written at the other.

What is a P0171 code measuring?

The engine measures the air coming in and injects what its map says that air needs. Then an oxygen sensor ahead of the catalytic converter reports what was left over after combustion, and the computer corrects. That correction is fuel trim, and it runs continuously on every modern engine.

There are two numbers. Short term fuel trim is the correction being made at this instant, and it moves constantly either side of zero. Long term fuel trim is what the computer has learned it must add or subtract on this particular engine, permanently, because the short term correction kept going the same way.

Long term trim is the diagnosis. A positive number means the computer is adding fuel beyond its map. When it can no longer add enough, it stops pretending and stores P0171.

The two fuel trim readings and what each value means. This is what to ask a shop to put on screen; no dashboard shows it.
What the scan tool showsWhat it isWhat it tells you
Short term fuel trimMoving all the timeThe correction being made right now, from the sensor ahead of the catalyst. It swings either side of zero, so a snapshot says almost nothing
Long term fuel trimThe one that mattersWhat the computer has learned it must add or subtract on this engine, permanently. This is the number a diagnosis is built on
ZeroNo correction neededThe mixture the engine is getting matches what the computer expected from the air it measured
A positive numberAdding fuelThe computer is adding more than its map called for, because the sensor keeps reporting lean. Air is arriving unmeasured, or fuel isn't
A negative numberTaking fuel awayThe opposite. Something is delivering more fuel than the computer asked for
Past its limitThe codeWhen long term trim runs out of room to correct, the computer stops pretending it can cope and stores P0171 or P0172

A lean code doesn't mean the engine is starved. It means the correction ran out, and that distinction decides where you look.

What are the two ways to be lean?

Unmetered air. A vacuum leak lets air into the engine after the mass air flow sensor has done its counting. The computer meters fuel for the air it measured, and more than that arrived, so the mixture is thin.

Fuel that never arrived. A tired pump, a restricted filter or a dirty injector delivers less than the computer asked for. The air was counted correctly and the fuel fell short.

There's a third that's neither: a mass air flow sensor reading low, which makes the computer meter fuel for less air than is genuinely entering. Replacing that sensor is fourth on the national repair list, at an average of $346.

And a fourth that's not a mixture problem at all: an exhaust leak ahead of the oxygen sensor. Fresh air reaching the sensor reads as leftover oxygen, so the computer adds fuel to correct a mixture that was never wrong.

Five causes sorted by whether the air is unmetered or mismeasured, with the condition that makes each one worst.
What is happeningWhich kind of leanWhen it is worst
A vacuum leakUnmetered airAir entering after the mass air flow sensor, never counted. Worst at idle, when airflow is small and the leak is a large share
A dirty or failing MAF sensorAir measured wronglyThe sensor under-reports, so the computer meters fuel for less air than is arriving. Fourth on the national repair list at $346
An exhaust leak upstreamFalse leanFresh air reaching the oxygen sensor reads as unburned oxygen, so the computer adds fuel to correct a mixture that was never wrong
Weak fuel deliveryFuel that never arrivedA tired pump, a restricted filter or a dirty injector. Worst under load, which is the opposite of the vacuum leak pattern
Bank 1 only, or both banksWhere to look nextP0171 alone points at one side, an injector or a local leak. With P0174 it points at something shared: the sensor, the pump, the filter

Which conditions make it worse is the cheapest clue available. Bad at idle and better under load is an air leak; the reverse is fuel delivery.

The free test: when is it worst?

This is the most useful thing on the page and it costs nothing.

A vacuum leak is worst at idle. At idle the engine is drawing very little air, so a fixed-size leak is a large share of the total and the mixture goes thin. Open the throttle and the leak becomes a rounding error against the volume now flowing, and trim settles down.

Weak fuel delivery is worst under load. At idle the demand is tiny and even a tired pump can meet it. Ask for full throttle up a grade and the shortfall appears.

Line diagram of the intake path with a mass air flow sensor plugged into the duct, marked as the point where the air is counted, and four numbered faults on either side of it: 1 a split hose letting air in after the count, 2 the sensor itself reading low, 3 an exhaust leak at a joint ahead of the oxygen sensor, 4 weak fuel delivery at the injector. Below, two panels compare idle against full load: at idle the uncounted slice is most of a narrow column of air, and under load the same slice is a sliver of a wide one while the fuel bar falls short of what was asked for
A fixed leak is most of a small airflow and almost none of a big one. Fuel delivery does the opposite, and that's the whole free test. Diagram: Oil & Miles
Use this image

Free to republish under CC BY 4.0: credit Oil & Miles and link to this page. The snippet does both.


              
              
            

So a car whose trim numbers are ugly at idle and calm on the highway is telling you to look for air. One that's fine around town and lean when worked is telling you to look at fuel. That's a diagnosis a reader can make in the driveway before spending anything.

Worth knowing

The bank in the code name is a second free clue. P0171 on its own points at something on one side of the engine: an injector, a local leak, one sensor. P0171 together with P0174 points at something both banks share, which is a much shorter list: the mass air flow sensor, the fuel pump, the filter, a leak in the intake before it splits.

Is a rich code the same system in reverse?

P0172 and P0175 are the mirror image: long term trim reached its limit while subtracting fuel. Something is delivering more than the computer asked for, or the sensor is reporting a mixture richer than reality.

Leaking injectors, excessive fuel pressure from a failed regulator, and a mass air flow sensor reading high all produce it. So does a contaminated oxygen sensor, which is why replacing that sensor is second on the national repair list at $287.

The reason both directions belong on one page is that the diagnosis is the same procedure with the arrow turned around. Read long term trim, note when it's worst, separate measurement faults from delivery faults.

Is P0174 the same code on bank 2?

Yes, on an engine that has two banks. We read the complaint record for this rather than counting it. A code named 88 times across a whole make is too thin to rank cars by, and we would rather say that than publish a league table it can't support.

An engine with two cylinder heads has two banks, each with its own oxygen sensor and its own fuel trim. Bank 1 contains cylinder number one. P0171 reports lean on bank 1, P0174 reports lean on bank 2, and an inline four or six has one bank and can't set P0174 at all.

What does the complaint record show about the two banks?

The record shows how lopsided the reporting is. P0171 is named 88 times in the complaints read for this article, P0174 only 14, spread across ten makes so thinly that no single one reaches five. Toyota leads with 4, three of them the Highlander; Ford has 2, and nobody else has more than one.

That thinness is the useful part. A code that appears once per make isn't telling you which cars run lean on bank 2.

What the thinness does tell you is that owners who see a lean code usually see it on bank 1 first, which is what you would expect if the common causes are shared: an intake leak, a dirty mass airflow sensor, weak fuel delivery. Those causes starve both banks, and bank 1 tends to be the one that reports.

So seeing P0171 and P0174 together is more informative than seeing either alone. Two banks going lean at once rules out most things that live on one side of the engine, and points at what they share: the air coming in, the fuel arriving, or the reading being wrong. One bank lean on its own points back at that bank's own plumbing.

How much does a P0171 code cost to fix?

$287 to $1,511, and it's one of three repairs rather than a total: an oxygen sensor at the low end, a catalytic converter at the high one.

What it costs

What a P0171 code costs to fix, cheapest first

Three repairs a lean code leads to, so there's no total: you pay one of them.

Oxygen sensorSecond on the national repair list. Often the sensor reporting the problem, not causing it$287Parts and labor, US average
Mass air flow sensorFourth on the list, and the one that most often actually is the fault$346Parts and labor, US average
Catalytic converterFirst on the list. What a lean mixture left running turns into$1,511Parts and labor, US average

CarMD Vehicle Health Index 2026, US averages across 39,116,755 repairs recommended in 2025, parts and labor together.

Why does a lean code become an expensive one?

Because a mixture that's persistently wrong runs the catalyst hotter than it was designed for. Left alone, that's one of the recognized paths to a dead catalytic converter, and the converter is first on the national repair list at $1,511.

The chain is worth stating plainly, because it's the reason this code is worth chasing while it's still cheap. A vacuum hose is a few dollars. A mass air flow sensor averaged $346.

The converter is more than four times that, and what protects it's not the sensor but the correct mixture the sensor was supposed to deliver. Our P0420 article sets out why the converter usually turns out to be the victim rather than the culprit.

The lean and rich codes as a set. One bank alone and both banks together point at different places, which is the whole reason to read them side by side.
CodeWhat it saysWhere to look first
P0171too lean, bank 1one side: local vacuum leak, one injector
P0174too lean, bank 2the other side, same list
P0171 and P0174 togethertoo lean, both bankssomething shared: MAF, pump, filter, intake before it splits
P0172too rich, bank 1injectors, fuel pressure, a sensor reading high
P0175too rich, bank 2the other side, same list

What a converter dies of, and what each of the cheaper repairs that prevent it costs, is set out in what a catalytic converter is. All of them cost less than the converter.

Which cars report a lean code most?

No make stands out. Chevrolet is the highest at 0.06% of its complaints and Toyota the next at 0.03%, a spread narrow enough to be noise. Unmetered air and weak fuel delivery aren't brand problems; every engine meters air and every engine pumps fuel.

From the national complaint record

0.06%

of Chevrolet complaints name P0171. It's the highest here, but only just: the next is 0.03%, and the spread across the whole list is narrow. Read this as the vehicles that show up, not as a ranking with a leader.

Share of each make's NHTSA complaints that name P0171, model years 2010 to 2025, 645,169 complaints read, every make on one scale.
Chevrolet0.06%34 of 58,248
Toyota0.03%11 of 36,545
Ford0.01%12 of 130,824
Source: NHTSA consumer complaints, the public database, published 25 August 2026 and read 22 September 2026. We counted every complaint filed on model years 2010 to 2025, 645,169 of them. Makes naming the code fewer than 10 times are left out, because below that a ranking is noise. Only 3 makes clear that bar for this code, so the list is short by nature rather than by trimming. Complaints measure who reported a fault, not how often a part fails.

What should you do about a P0171 code?

Five steps for narrowing a lean code down to a cause before anyone sells you a part. Two of the first three cost nothing, and between them they usually decide which half of the engine you're dealing with. 5 steps below:

  1. Read long term fuel trim, not short term. Fuel trim is the percentage the computer is adding to or taking off the fuel to hold the mixture right. Any scan tool that shows live data will show both, and reading a code is free at most US parts chains. The long term number is the one a diagnosis is built on.
  2. Note when the running is worst. Ugly at idle and calm at speed is air. Fine at idle and ugly under load is fuel. This costs a drive.
  3. Check whether both banks are complaining. One bank narrows it to that side. Both banks narrows it to what the two share.
  4. Rule out the false lean. An exhaust leak ahead of the oxygen sensor produces the code with a perfectly good mixture, and it's audible.
  5. Fix it while the cause is still a hose. A lean condition left running is one of the ways a converter dies, and that repair is more than four times the sensor's price.

Conclusion

The code says how much, not what

The code tells you how much the computer had to add, not what to replace. Long term fuel trim reaching its limit is the whole content of it: either air is getting in that was never measured, or fuel isn't arriving that should be. Which half you're in is decided by a reading, not by a guess.

And that reading is free at most US parts counters, which puts it ahead of every part anyone might sell you. Oil & Miles reads the number before it names the part, across symptoms.

Common questions

Asked most often

Can the fuel itself cause a P0171 code?

It can, and it's the uncommon case. Ethanol carries oxygen inside its own molecule where gasoline's hydrocarbons carry none, and a gallon of it holds about two thirds the energy. More ethanol than the computer expects needs more fuel for the same air, which reads lean until the car learns it.

Will a P0171 code clear itself?

The lamp can; the code mostly won't. The car turns the lamp off after three sequential driving cycles in which the monitor ran and found nothing, and the stored code stays in memory for around forty warm-up cycles regardless. So have the codes read even after the light has gone out.

What does the P0171 code mean?

System too lean on bank 1. More precisely, long term fuel trim reached the limit of what it could add. The engine isn't necessarily starved of fuel; the computer has simply run out of room to compensate for something.

Can you drive with a P0171 code?

Usually yes, in the short term, and the car may feel normal. What it is doing meanwhile is running the catalyst hotter than intended, which is why this is worth fixing before it becomes a converter.

What causes a P0171 code?

Unmetered air, usually a vacuum leak, and a mass air flow sensor reading low. Replacing that sensor is fourth on the national repair list at $346. Fuel delivery faults produce the same code and behave differently under load.

Is P0171 expensive to fix?

It depends entirely on the cause. A split vacuum hose is a few dollars, a mass air flow sensor averaged $346 nationally, and a fuel pump is more. All of them are less than the $1,511 converter a lean condition works towards.

What is the difference between P0171 and P0174?

The bank. P0171 is bank 1, P0174 is bank 2, and an inline engine has only one bank so it can't set P0174. Seeing both is more useful than seeing either, because it points at what the two banks share.

Can an oxygen sensor cause P0171?

Yes, by reporting a mixture leaner than reality, which makes the computer add fuel it didn't need to. An exhaust leak ahead of that sensor does the same thing by letting fresh air reach it.

Sources

  1. Alternative Fuels Data Center, Fuel Properties Comparison. For the chemical structures - ethanol CH3CH2OH against gasoline's C4 to C12 - and the energy content, 76,330 Btu per gallon for E100 against 112,114 to 116,090 for gasoline. Read September 18, 2026. US Department of Energy
  2. CarMD Vehicle Health Index 2026, read as the published PDF, for every price on this page. CarMD sells diagnostic tools, an interest worth naming. CarMD.com Corp, read August 2026
  3. The causal chain from a lean condition to a failed catalyst is set out with its sources in our own P0420 article: a mixture persistently wrong overheats the catalyst, and an exhaust leak upstream of the sensor produces a false lean reading. Oil & Miles, September 2026
  4. The idle against load test is reasoning, not a citation. It follows from a fixed leak being a large share of a small airflow and a negligible share of a large one. No source is offered because none should be implied. Oil & Miles

How this was compiled

The complaint counts come from NHTSA's published bulk download rather than its search page, so the whole record is counted rather than a sample. The file is FLAT_CMPL, and the copy read here is dated 25 August 2026.

NHTSA files one row per component a complaint names, so the count is by complaint number rather than by row: across the 2010 to 2025 model years that is 645,169 complaints, and those are what was scanned for this article.

The article covers the lean and rich codes on one page because they're the same system read in two directions, and splitting them would mean writing the same explanation twice with the sign reversed. It leads with what fuel trim is rather than with a list of causes, because almost every symptom on the usual list belongs to more than one cause and the trim numbers are what separate them.

What we didn't do

  • We give no fuel trim percentage that counts as a fault. Manufacturers set their own thresholds, the figures in circulation are rules of thumb rather than specifications, and quoting one as a limit would be inventing a standard.
  • We didn't scan a vehicle, smoke test an intake or measure fuel pressure for this article.
  • We give no frequency ranking of causes. Nothing published counts them in a way we would repeat.
  • We name no parts brand and recommend no scan tool.

Prices are ranges compiled in August 2026 for the US market and vary by region, engine and shop rate. Prices from $10 up are rounded to the nearest dollar, so $14.13 reads as $14 and $14.52 as $15. Below $10 they're exact. This article is general information, not advice about your specific vehicle, see the disclaimer.