P0171 is your engine's way of saying it's burning too much air relative to fuel

The P0171 code means your engine's oxygen sensor detected that the fuel mixture is too lean—more air than fuel is entering the combustion chamber. Your car's computer tries to correct this automatically by adding more fuel, but if the sensor keeps reading lean, the check engine light comes on and the code stores.

This is not a single broken part. P0171 is a symptom that points to one of several possible causes: a vacuum leak, a faulty oxygen sensor, a failing fuel pump, a clogged fuel filter, or a problem with the fuel injectors. Fixing it means finding which one is actually broken, not just replacing parts until something works.

The code appears on Bank 1, which is the side of the engine that contains cylinder number one. If both banks are running lean, you have a fuel system problem. If only Bank 1 is lean, the issue is usually on that side of the engine—a vacuum leak near those cylinders, or a sensor on that bank.

Key Takeaways

  • P0171 means the engine is running lean (too much air, not enough fuel), and your oxygen sensor detected it.
  • The most common causes are vacuum leaks, a faulty oxygen sensor, a clogged fuel filter, or a failing fuel pump.
  • You need a scan tool to read the freeze frame data and live sensor readings, which narrows down the cause faster than guessing.
  • Start with the cheapest and easiest checks—vacuum hoses, fuel filter condition, and oxygen sensor age—before moving to fuel pump testing.
  • If the code returns after you fix one thing, the underlying cause may be something else, and you should retest rather than assume the first fix worked.

How to diagnose P0171 yourself with basic tools

You need a code reader or scan tool to see what your oxygen sensor is actually reporting. A basic OBD-II scanner (under $30) will pull the code and show you freeze frame data—the engine conditions at the moment the code triggered. A more advanced scanner shows live data: real-time oxygen sensor voltage, fuel trim numbers, and fuel pressure readings.

Start by checking fuel pressure. Most fuel systems run between 40 and 60 PSI at idle, depending on your car's year and model. You can rent a fuel pressure gauge from an auto parts store for $10 to $20. If pressure is below spec, the fuel pump is weak or the fuel filter is clogged. If pressure is normal, move to the next step.

Next, look for vacuum leaks. These are the most common cause of P0171. Spray carburetor cleaner around vacuum hoses, intake gaskets, and the PCV system while the engine idles. If the idle speed changes or the engine stumbles, you found a leak. Vacuum leaks pull unmeasured air into the engine, which the oxygen sensor reads as a lean condition.

Check the oxygen sensor itself. If it is more than 100,000 miles old, it is likely failing. A bad oxygen sensor sends false lean readings even when the fuel mixture is correct. If you have a scan tool showing live data, a healthy oxygen sensor voltage should swing between 0.1 and 0.9 volts at idle, switching back and forth. A sensor that stays stuck in the middle or does not switch is bad.

Vacuum leaks and intake gasket failures

Vacuum leaks are the number-one cause of P0171 because they are invisible and common. Any crack in a hose, a loose clamp, or a failing intake manifold gasket pulls air directly into the engine without passing through the mass airflow sensor. The computer does not know this extra air is there, so it does not add extra fuel to match it. The oxygen sensor sees the lean condition and triggers the code.

Check every vacuum hose you can see. Look for cracks, splits, or hoses that have come loose at their connections. Hoses that are more than 10 years old become brittle and fail. If you find a cracked hose, replace it with a new one of the same diameter. If a hose is just loose, push it back on firmly and see if the code clears after a few drive cycles.

Intake manifold gaskets fail over time and develop small leaks that are hard to spot. If you have already ruled out hoses and the fuel system, and the oxygen sensor is not the problem, the intake gasket is the next likely culprit. This repair requires removing the intake manifold, which is labor-intensive but straightforward. A mechanic can do it in 2 to 4 hours depending on your engine layout.

Oxygen sensor replacement and testing

An oxygen sensor costs $40 to $200 depending on whether it is upstream (before the catalytic converter) or downstream (after it). Bank 1 upstream is the one that triggers P0171. If your sensor is original equipment and your car has over 80,000 miles, replacing it is a reasonable first step because sensors do fail and a new one is cheaper than hours of diagnosis.

To test the sensor before replacing it, use a scan tool to watch its voltage while the engine idles. A good sensor should read between 0.1 and 0.9 volts and switch back and forth every second or so. If it stays stuck at 0.45 volts (the middle), it is dead. If it does not move at all, it is also bad. If it swings normally but you still have the code, the sensor is not the problem.

Oxygen sensors can fail in ways that are hard to catch without live data. A sensor that reads lean when it should read rich will cause the computer to add fuel, but if the sensor is wrong, adding fuel does not help. The code comes back because the real problem is not fuel delivery—it is a sensor that is lying about what it sees.

Fuel pump and fuel filter checks

A weak fuel pump delivers less pressure than the engine needs, which causes a lean condition because the injectors cannot spray enough fuel. Fuel pressure should be steady and within your car's specification (usually 40 to 60 PSI). If pressure drops when you accelerate, the pump is failing. If it is low at idle and stays low, the pump or filter is the problem.

A clogged fuel filter restricts flow and drops pressure. Fuel filters are cheap ($15 to $50) and straightforward to replace on most cars. If your car has over 30,000 miles since the last filter change, replacing it is worth doing anyway. A new filter may solve the problem if pressure was low.

If fuel pressure is normal but the code persists, the fuel pump itself is probably not the issue. Move on to vacuum leaks and sensors. If pressure is low and you replaced the filter and the pressure is still low, the pump is weak and needs replacement. Fuel pump replacement is more expensive ($400 to $1,200 depending on whether the pump is in the tank or on the frame) and usually requires a mechanic.

Fuel injector problems and carbon buildup

Dirty or failing fuel injectors can cause a lean code if they are not spraying the right amount of fuel. Carbon buildup inside the injector reduces the fuel spray pattern, which means less fuel reaches the combustion chamber even though the injector is firing. This is less common than vacuum leaks or sensor failure, but it happens on high-mileage engines.

A fuel system cleaner additive (poured into the gas tank) can help if carbon is the problem. These cost $10 to $20 and work over several fill-ups. If the code clears after running a bottle through, carbon was the issue. If the code comes back, the injectors may need professional cleaning or replacement.

Injector testing requires a mechanic with a scope or injector tester. They can see whether each injector is firing and spraying the right pattern. If one injector on Bank 1 is stuck or weak, it would cause that bank to run lean. This is a less common diagnosis, but it is worth considering if everything else checks out.

What to do if the code comes back after you fix something

If you replaced the oxygen sensor and the code returned after 50 to 100 miles, the sensor was not the real problem. Go back and check for vacuum leaks more carefully. Use a smoke machine if you have access to one—a mechanic can do this in 30 minutes and it shows exactly where air is leaking in.

If you fixed a vacuum leak and the code came back, make sure the leak is actually sealed. Hose clamps can loosen again, and gaskets can fail in multiple places. Drive the car for at least 100 miles before assuming the fix worked. Your car's computer needs several drive cycles to clear the code, and it will not clear if the problem is still there.

If you have replaced the sensor, checked for leaks, and verified fuel pressure, and the code still comes back, take the car to a mechanic with a scope or advanced scan tool. At that point, you are looking at either a failing fuel pump, a problem with the fuel injectors, or something unusual like a mass airflow sensor that is reading wrong. These require specialized equipment to diagnose.

Frequently Asked Questions

Can I drive with a P0171 code?

Yes, but not for long. A lean-running engine can damage the catalytic converter and cause overheating. If the code is new, drive only to a mechanic or parts store. If it has been on for weeks, the converter may already be damaged and you should not drive it at highway speeds.

Will a P0171 code go away on its own?

No. The code will stay until you fix the underlying problem. Your car's computer will not clear it just because time has passed. You have to repair the cause, then drive normally for 100 to 200 miles so the computer can confirm the problem is gone.

What is the difference between Bank 1 and Bank 2?

Bank 1 is the side of the engine with cylinder number one. Bank 2 is the other side. If only Bank 1 is lean, the problem is usually on that side—a vacuum leak near those cylinders or a sensor on that bank. If both banks are lean, the problem is in the fuel system itself.

Should I replace the oxygen sensor or test it first?

If your sensor is over 100,000 miles old, replacing it is often faster and cheaper than testing. If it is newer, test it with a scan tool first. A sensor that does not swing between 0.1 and 0.9 volts is bad and should be replaced.

How much does it cost to fix P0171?

It depends on the cause. A vacuum hose is $5 to $20. An oxygen sensor is $40 to $200. A fuel filter is $15 to $50. An intake gasket is $300 to $800 in labor. A fuel pump is $400 to $1,200. Start with the cheapest checks first and work your way up.