P0171 means the engine control module's long-term fuel trim on bank 1 reached its positive limit: it added as much fuel as the calibration allows and the bank 1 oxygen sensor still reported a lean mixture. P0174 is the same fault on bank 2; P0172 and P0175 are the rich versions. On an inline engine there is one bank and only P0171 appears. On a V engine, P0171 alone means the cause is on bank 1; P0171 with P0174 means the cause is shared by both banks.
Severity: moderate. Can you keep driving? For a short time. A lean engine hesitates, idles rough, may stall at stops, and runs hotter in the chamber; on a turbocharged engine a lean condition under load can damage pistons. The check engine light comes on and the catalyst monitor may not run. Have it diagnosed within days, and sooner if there is any misfire.
The short explanation, with the common leak sites, lives at P0171 lean code and vacuum leaks; this page is the diagnosis by numbers.
How to read the trims
The module corrects the mixture two ways. Short-term fuel trim (STFT) swings second by second in response to the oxygen sensor. Long-term fuel trim (LTFT) is the learned correction the module applies before the short-term correction starts, so that the short-term value can stay near zero. Both are shown as a percentage of extra (positive) or less (negative) fuel. P0171 sets when the long-term value, or the sum of the two, exceeds the calibrated limit, typically around plus 20 to 25 percent, under defined conditions.
The diagnostic value is in where the trims are high:
- High at idle, near normal at cruise: unmetered air. A vacuum leak is a fixed volume of air; at idle it is a large share of what the engine breathes, at cruise a small one. This is the vacuum leak signature.
- Near normal at idle, high at cruise and under load: fuel supply. A weak pump, a restricted filter or a failing injector cannot keep up when demand rises.
- High at both, roughly equally: the sensor that measures air is reading low (a dirty or failing mass airflow sensor) or the exhaust is lying (an exhaust leak ahead of the oxygen sensor drawing in air, or a sensor biased lean).
- High on both banks: something shared: airflow sensor, fuel pressure, a leak at the throttle body or the intake manifold plenum, the purge valve, or a flex-fuel estimate.
- High on one bank only: an intake manifold gasket on that side, an injector on that side, or an exhaust leak or sensor on that side.
Read the trims before touching anything, and the diagnosis is half done.
What the manufacturers documented
Ford F-150 5.0 L flex fuel, 2018 to 2020 (special service message 48573): P0171, P0172, P0174 or P0175, due to incorrect flex fuel learning, often caused by customer refueling habits or a stuck-open EVAP purge valve. The engine estimates ethanol content from the trims after a refuel; a purge valve dumping vapor during that learn, or small top-offs with fuel of a different ethanol content, corrupts the estimate. The trims then fight a mixture that is wrong for the fuel the engine thinks it has. No leak, no pump, no injector.
Ford F-150 2018 with the 2.7 L EcoBoost built on or before 12 July 2018 (TSB 18-2310, October 2018): P0171 and P0174 with misfire, rich and imbalance codes, corrected by replacing the six high-pressure direct injectors with clips, tubes and gaskets. Injectors failing as a set produce a lean bank as readily as a rich one.
Kia Optima 2011 to 2015, Sorento 2012 to 2015 and Sportage 2014 to 2016 with the 2.4 L GDI (TSB ENG 160, October 2016): P0420, possibly with P0171, most commonly during prolonged engine braking down a steep grade. The ECU upgrade addressed how the engine handled fuel cut on long descents; the lean code was a byproduct of the same condition that overheated the catalyst.
General Motors V6 and V8 engines 2014 to 2020 (bulletin 20-NA-098, May 2020): guidelines for fuel injector replacement when P0171, P0172, P0174, P0175 and the misfire codes set, requiring that an injector fault be confirmed with the factory tests before a set is replaced. The bulletin exists because sets of injectors were being replaced for lean codes that were not injector faults.
Causes, in the order they are found
A vacuum leak after the airflow sensor: an intake manifold gasket (Ford's V6 and V8 engines have long histories here), a cracked or loose intake boot, a brake booster hose or the booster's own diaphragm, a PCV valve or hose, an EVAP purge line, a throttle body gasket, or an intake manifold that has warped. On direct-injection engines with a plastic manifold, a crack near the runners is common.
A dirty or failing mass airflow sensor reading less air than the engine takes in. Oil from an oiled aftermarket filter, or dust past a poor filter seal, coats the element.
A weak fuel pump, a restricted filter, or low fuel pressure from a failing regulator: trims rise with load.
Injectors clogged or failing, individually (one bank) or as a set (both), as on Ford's 2.7 L.
An exhaust leak ahead of the upstream oxygen sensor: a cracked manifold or a flange gasket lets air reach the sensor, which reads lean and drives the trims positive with a mixture that was right.
An upstream oxygen sensor biased lean or contaminated.
A purge valve stuck open feeding vapor and air in a pattern the module cannot trim, and on flex-fuel engines corrupting the ethanol estimate, as on Ford's 5.0 L.
A PCV valve stuck open, on engines where it admits enough air to matter.
A calibration, as on the Kia.
The module, last.
A diagnostic order
- Read the trims at idle and at a steady 2,500 rpm, both banks, engine warm. Note the pattern from the list above. Pull the freeze frame: engine speed and load at the fault confirm it.
- Check for a bulletin on the exact engine.
- On a flex-fuel engine, check the ethanol estimate against the fuel actually used, and test the purge valve for leakage with a hand vacuum pump.
- Look at the airflow sensor reading at idle against the engine's displacement: a healthy engine draws roughly 1 gram per second per liter at idle, warm. A reading well below that with a good idle is a sensor reading low or a leak after it.
- Smoke the intake with the engine off if the trims say leak; watch the brake booster, the PCV system and the intake manifold runners.
- Check fuel pressure at idle and under a snap throttle, and hold under load on a road test if the trims rise with load.
- Look and listen for an exhaust leak at the manifold and the flange, cold, with a hand near the joints.
- Compare the upstream oxygen sensor's response with a propane or vacuum test; a sensor that will not read rich with propane added is biased.
- Clean the airflow sensor with the proper cleaner if it reads low and nothing leaks; replace it if the reading does not recover.
- Repair the cause, clear the trims and the code, and verify that trims return near zero at idle and cruise on a drive. Let the readiness monitors complete before an inspection.
What P0171 does not tell you
It does not tell you there is a vacuum leak. It tells you the module ran out of fuel correction on bank 1, and a leak, a low-reading airflow sensor, a weak pump, an injector, an exhaust leak, a biased sensor, a purge valve and a flex-fuel estimate all do that. The trims at idle versus load, and on one bank versus both, are what separate them; Ford's flex-fuel case is the proof that a lean code can have no lean cause at all. The general principle is covered in what a trouble code does not tell you.
Frequently asked questions
Can I drive with a P0171 code?
For a short time. A lean engine hesitates and may stall, and lean under load on a turbocharged engine can damage pistons. Have it diagnosed within days, and stop if a misfire develops or the check engine light flashes.
Is P0171 always a vacuum leak?
No. A vacuum leak is the most common cause and shows as trims high at idle and near normal at cruise. Trims high under load point at fuel supply; high everywhere point at the airflow sensor or an exhaust leak; on Ford's 2018 to 2020 F-150 5.0 L the cause was flex-fuel learning corrupted by refueling habits or a purge valve, with no leak at all.
What is the difference between P0171 and P0174?
P0171 is bank 1 lean, P0174 is bank 2 lean. One alone means the cause is on that bank: an intake gasket, an injector, an exhaust leak or a sensor on that side. Both together mean something shared: the airflow sensor, fuel pressure, a leak at the throttle body or plenum, the purge valve or a flex-fuel estimate.
Why did P0171 come back after I fixed a vacuum leak?
Either there is a second leak (booster hoses and PCV hoses hide behind manifold gaskets), or the leak was never the main cause and the trims were high under load as well, pointing at fuel supply or the airflow sensor. Read the trims again at idle and at cruise after the repair.
How much does it cost to fix P0171?
A hose or a PCV valve is inexpensive. Cleaning an airflow sensor costs little; replacing one is moderate. An intake manifold gasket is a few hours. A fuel pump is a moderate part with tank access labor. Injectors range from moderate to major on direct injection, which is why GM's guidelines require confirming an injector fault first.
Related codes
- P0174: system too lean bank 2. P0172 / P0175: system too rich; see P0175.
- P0101 to P0103: mass airflow sensor circuit and range.
- P0300 series: misfires caused by a lean mixture; see P0300.
- P0441 / P0496: purge flow codes, involved in Ford's flex-fuel case.
- P0068: MAP, MAF and throttle correlation, another way the same unmetered air shows up; see P0068.
- P2195 / P2196: oxygen sensor signal stuck lean or rich.
The code number itself tells you the family and the domain; how to read an OBD2 code number explains what each character means.