OBD-II Car P0171 Error
What it means
P0171 means the engine is running too lean on Bank 1 — there is too much air relative to fuel in the mixture. The computer detects this through the oxygen/air-fuel sensor and tries to compensate by adding fuel (you will see high positive long-term fuel trim, often +15% to +25% or more). When it can no longer correct enough, it sets P0171. Typical symptoms are a check engine light, rough or unstable idle, hesitation or stumbling on acceleration, occasional misfires, and sometimes a slight loss of power or worse fuel economy.
Common causes of the P0171 error
- Vacuum leak — cracked intake boot, split vacuum hose, or leaking intake manifold gasket (very common)
- Dirty or faulty mass air flow (MAF) sensor under-reporting incoming air
- Weak fuel delivery: failing fuel pump, clogged fuel filter, or dirty/clogged injectors
- Faulty or low fuel pressure regulator
- Leaking or worn-out oxygen / air-fuel ratio sensor sending a false lean reading
- PCV system leak or stuck-open PCV valve adding unmetered air
How to fix the OBD-II Car P0171 error
- 1Check fuel trims and look for a vacuum leakRead short- and long-term fuel trims with a scan tool. If the lean condition mostly disappears at higher RPM, suspect a vacuum leak (which is proportionally smaller as airflow rises). Inspect intake boots, vacuum hoses, the PCV system, and the brake booster line; spraying a little throttle-body cleaner near suspect joints and watching idle change can locate a leak.
- 2Clean or test the MAF sensorA contaminated MAF sensor tells the computer less air is entering than really is, so it adds too little fuel and runs lean. Clean the sensor element with dedicated MAF cleaner only. If readings are still off versus spec, replace the MAF.
- 3Verify fuel pressure and deliveryTest fuel pressure at idle and under load. Low pressure from a tired pump, clogged filter, or failing regulator starves the engine and causes a lean code. Clean or test injectors if pressure is fine but the lean condition remains.
- 4Inspect the oxygen / air-fuel sensorIf air, vacuum, and fuel all check out, the upstream O2/AF sensor may be reporting a false lean signal. Compare its live data to expected switching behavior and replace it with an OEM-grade part if it is sluggish or stuck.
🧰 When to call a professional
Call a professional if you cannot locate a vacuum leak (a shop can run a smoke test), if fuel pressure is out of spec and you are not comfortable working on the fuel system, or if the code returns after cleaning the MAF and checking the obvious sources. Persistent lean conditions can also cause misfires that damage the catalytic converter, so do not let it linger.
OBD-II P0171 error — FAQ
Is it safe to drive with this code?
Short-term, light driving is usually okay if the car still runs smoothly. But a lean mixture runs hotter and can cause misfires and, over time, damage the catalytic converter or pistons. If you notice rough running, stalling, or a flashing check engine light, get it diagnosed promptly rather than continuing to drive.
How much does it cost to fix?
It depends on the cause. A vacuum hose or PCV valve may be under $50. Cleaning a MAF sensor is nearly free; replacing one runs about $150–$400. A fuel pump can be $400–$900 installed, and an oxygen sensor roughly $150–$350. Shop diagnosis (often including a smoke test) is typically $75–$150.
Can a loose gas cap cause P0171?
No. A loose gas cap affects the evaporative emissions system and sets EVAP codes such as P0442/P0455, not a lean fuel-trim code. P0171 is about the actual air-fuel mixture entering the engine, so focus on vacuum leaks, the MAF sensor, and fuel delivery instead.
Sources
This guide is independently written and not affiliated with OBD-II. Always unplug appliances before servicing and follow your model's manual. Error codes and steps can vary by model — when in doubt, consult a qualified technician.