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.
The bottom line on the P0171 error
P0171 means Bank 1 is running lean, and about half the time the culprit is a vacuum leak — a cracked intake boot, split hose, or worn PCV. A dirty MAF sensor is the other common suspect. The trap is throwing parts at it: a lingering lean condition runs hot and can damage the catalytic converter.
Start cheap — hunt for the leak and clean the MAF before buying a $150–$400 replacement, since a hose or PCV valve is often under $50. It is a doable DIY; call a shop for a smoke test ($75–$150) when you cannot find the leak.
P0171 snapshot
Our own at-a-glance triage of the P0171 error, from the verified data on this page. See error-code rankings → · How we score →
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
Which OBD-II cars get the P0171 error
P0171 is universal on OBD-II vehicles but is notoriously common on certain engines: many Ford models (4.6L/5.4L, EcoBoost) develop it from cracked plastic intake components, older Toyota/Lexus and Nissan four-cylinders throw it from dirty MAF sensors, and any aging engine with brittle vacuum hoses or a worn PCV is a candidate. Vacuum leaks alone account for roughly half of all P0171 cases.
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 vs OBD-II P0174 vs OBD-II P0300: how they compare
How this code stacks up against related error codes for difficulty, urgency, and cost.
| OBD-II P0171 | OBD-II P0174 | OBD-II P0300 | |
|---|---|---|---|
| DIY difficulty (1–5) | 3 | 3 | 3 |
| Urgency (1–5) | 3 | 3 | 4 |
| Typical cost | $$ | $$ | $$ |
How much does it cost to fix the P0171 error?
| DIY parts only | $20–$300 |
| Professional diagnosis & repair | $100–$500 |
| If major component (fuel pump) | $1,000–$1,300 |
Repair or replace?
P0171 is usually a moderate, affordable fix because the top cause — a vacuum leak — is often just a cracked hose, PCV valve, or intake gasket costing under $50–$300. Cleaning a dirty MAF sensor can be nearly free and resolve it entirely, so try that before buying a $150–$400 replacement. DIY is very doable for hose and MAF work; pay a shop ($75–$150 diagnosis, often including a smoke test) when you cannot locate the leak or when fuel pressure is out of spec — a failing fuel pump runs $1,000–$1,300 installed. Do not let a lean condition linger: it runs the engine hotter and can trigger misfires that damage the catalytic converter over time.
Common replacement parts for the P0171 error
| Vacuum hose / PCV valve | $10–$50 | Most common and cheapest fix | |
| MAF sensor | $150–$400 | Clean first (nearly free); replace only if still out of spec | |
| Intake manifold gasket | $100–$300 | Common leak point on aging four-cylinders | |
| Fuel pump | $1,000–$1,300 | RepairPal average if low fuel pressure is the cause |
Prices are typical retail ranges and vary by model and supplier — always confirm the exact part number for your appliance before buying.
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 & manufacturer references
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.