P0171 Code: What It Means and How to Fix It
P0171 means your engine is running lean on Bank 1, with too much air for the fuel. The fix depends on the cause, so start with the cheapest checks and move toward the expensive ones.
Check hoses, intake gaskets and the MAF sensor before buying parts. Fuel pump work should wait until fuel pressure has been tested.
This guide is general information only. Fuel system and exhaust work carry fire and injury risk, so have a qualified technician handle any repair you are unsure about.
What the P0171 Code Means
P0171 means the engine is running lean on Bank 1, with too much air compared to fuel. Bank 1 is the side of the engine that contains cylinder #1.
Mitchell1’s diagnostic guide describes the code the same way. The ideal air-fuel ratio is 14.7 to 1, and a mixture that leans out of that range sets the code. The code tells you which bank is affected, not which part has failed, so the diagnosis still has to find the cause. The computer usually stores the code when the lean condition shows up as a pattern rather than a single reading, which is why a short test drive may not bring it back right away. Because the code names a bank rather than a part, two vehicles with the same code can need completely different repairs.

Common Causes of P0171
The most common causes of P0171 are vacuum or intake leaks, a dirty or faulty MAF sensor, a weak fuel pump or clogged fuel filter, exhaust leaks near the oxygen sensor, and aging oxygen sensors. Some add unmetered air, while others reduce the fuel that reaches the engine. If the fuel trim problem points at the sensor itself, see checking an oxygen sensor replacement bill before you approve the work.
- Vacuum leaks: cracked hoses or intake gaskets let air bypass the sensors.
- Dirty or faulty MAF sensor: it can misread how much air enters the engine.
- Weak fuel pump or clogged fuel filter: fuel pressure drops, so the mixture runs lean.
- Exhaust leaks near the oxygen sensor: outside air can skew the sensor reading.
- Aging oxygen sensors: an older sensor may report the mixture inaccurately.
| Cause | Side | Where to look first |
|---|---|---|
| Vacuum or intake leak | Air | Hoses and intake gaskets |
| MAF sensor | Air | Sensor condition and wiring |
| Fuel pump or fuel filter | Fuel | Fuel pressure reading |
| Exhaust leak | Exhaust | Pipe and manifold joints near the oxygen sensor |
| Oxygen sensor | Sensor | Live readings and sensor age |
Air-Side Causes
Vacuum leaks and a dirty MAF sensor both change how much air the engine measures. Check for cracked hoses and loose clamps first, because they take little time to inspect.
Fuel-Side Causes
A weak fuel pump or clogged fuel filter lowers fuel pressure, so the injectors deliver less fuel than the engine needs. A fuel pressure test shows whether this is the problem.
Symptoms that often go with a lean condition include a rough idle, hesitation when you press the accelerator and a drop in fuel economy. These signs point toward a lean mixture, but they do not tell you which cause is responsible, so the tests still come first.
How to Fix P0171
To fix P0171, read the freeze-frame data with an OBD-II scanner, check for air leaks, test fuel pressure, then clean or replace the part the tests point to. Work from the cheapest checks to the most expensive, because each step narrows the cause before you buy parts. A lean mixture can also set off misfires, which is covered in random misfire code symptoms. A weak fuel pump can also cause a lean mixture, so fuel pressure gauge test steps is worth doing before you replace parts.
- Read the freeze-frame data and fuel trim with an OBD-II scanner to see the conditions when the code set.
- Inspect intake hoses, clamps and gaskets for cracks or loose fittings, then look for leaks with a smoke test.
- Check fuel pressure against the manufacturer’s specification to separate fuel-side causes from air-side causes.
- Clean the MAF sensor with a cleaner made for MAF sensors, then retest. Replace it only if cleaning does not fix the reading.
- Look for exhaust leaks near the oxygen sensor, and repair any you find.
- Replace an aging oxygen sensor last, once the other causes have been ruled out.
Clear the code only after the repair, then drive the vehicle and confirm the code does not return. Fuel trim readings show how far the computer is correcting the mixture, which is a topic for a separate guide.
The most common mistake is replacing the MAF sensor or an oxygen sensor before testing for leaks and fuel pressure. A leak or weak pump can make a healthy sensor look faulty, so the part you replace may not be the cause. Test first, then buy.

What a P0171 Fix Costs
A P0171 fix can cost very little or much more, depending on the cause, so the diagnosis is the first cost to plan for.
| Cause | Typical work | Main cost driver |
|---|---|---|
| Vacuum leak | Replace a hose or gasket | Part price and how hard the leak is to reach |
| MAF sensor | Clean first, then replace if needed | Cleaning is inexpensive; replacement depends on the vehicle |
| Fuel pump or fuel filter | Test pressure, then replace the filter or pump | Pump labor and access to the pump |
| Exhaust leak | Repair the joint or pipe | Amount of exhaust work needed |
| Oxygen sensor | Replace the sensor | Sensor price and how hard it is to access |
Labor rates and the vehicle model change totals more than the part price does. Get a written estimate from a shop that has diagnosed the code, and ask which test showed the cause before approving parts. Ask whether the quote includes diagnosis, because some shops charge for the test separately. That charge is usually worth paying if it prevents a part swap that does not clear the code, since a cheap part that misses the cause costs more in the end.
Can You Keep Driving With a P0171 Code?
Often yes for a short trip, but a lean condition left unrepaired is not a fix you should postpone. Some repair sources warn that long-term lean running can stress the catalytic converter, so schedule the diagnosis soon.
Stop driving and have the vehicle inspected if the engine runs rough, stalls or the check engine light flashes. This advice does not apply if the scan shows other codes, because those need their own diagnosis.
Trade-off: a short delay to book a diagnosis is reasonable, but leaving the code for months means driving for a long time with a fault you already know about. The sooner the cause is found, the fewer parts are likely to need replacing. If you are unsure how urgent the code is on your car, a shop can tell you after a quick scan of the freeze-frame data.
P0171 on Toyota, Chevy, Ford, Honda and Nissan
P0171 means the same thing on each of these makes, but the causes and repair steps depend on the engine. The MAF sensor location, hose routing and fuel system layout differ from one engine to the next.
Check your make’s service information, or a repair database that covers your exact year, make and engine, before ordering parts. That single check often saves a wrong guess on a part that is not the cause.
Engine layout matters too. Inline four-cylinder and V6 engines arrange their cylinders differently, so the location of Bank 1 and the sensors on your engine may not match a guide written for another engine. Confirm the bank and cylinder layout for your exact engine before you start testing.
Frequently Asked Questions
Does P0171 always mean a vacuum leak?
No. A vacuum leak is one common cause, but a dirty MAF sensor, a weak fuel pump, a clogged filter or an aging oxygen sensor can set the same code. Fuel pressure and sensor tests help tell them apart.
Can I clear the P0171 code myself?
Yes, with an OBD-II scanner, but clearing the code does not fix the cause. If the lean condition continues, the code and the check engine light return.
Will the P0171 code come back after a repair?
It can, if the underlying fault is still present. Once the engine computer detects the lean condition again, it sets the code again, so confirm the repair with a scan after a test drive.
Which tool do I need to diagnose P0171?
An OBD-II scanner that shows freeze-frame and fuel trim data is the minimum. A fuel pressure gauge helps with the fuel side of the diagnosis.
What should I bring to a shop for a P0171 code?
Bring the code, the date it first appeared, whether the light flashes, and any recent repairs. Ask the shop to show the freeze-frame and fuel trim data they used to reach their diagnosis.
How long does a P0171 diagnosis take?
It depends on how many tests are needed. A scan and a visual check of hoses can be quick, while fuel pressure and leak testing take longer. Ask the shop for an estimate of the diagnosis time before you approve it.
If the basic checks pass and the code returns, have a shop test fuel pressure and read live fuel trim before buying parts. Replacing expensive components by guesswork is the costliest way to repair a P0171 code.
-
Nicole Bennett, Technical Content Editor at BestOBD2Picks Nicole turns OBD-II standards, service bulletins, and repair data into step-by-step diagnostic guides anyone can follow. Technical Content Editor