P0171 Code
A P0171 code means your engine computer has found too much air and not enough fuel on Bank 1, which mechanics call running lean. According to Kelley Blue Book, the code gets stored when the computer has added all the fuel it can and still can't balance things out.

What does the P0171 code mean?
The code's full name is "System Too Lean (Bank 1)." To run well, your engine needs air and fuel blended in the right proportion. If there's extra air in that blend, the computer responds by adding fuel. P0171 shows up when the computer has maxed out that adjustment and the blend is still too lean.
The code is triggered by readings from the upstream oxygen sensor on Bank 1.
Which side is Bank 1, and what other codes appear?
Bank 1 refers to the side of the engine where cylinder 1 sits. If your engine has 2 rows of cylinders, one row is Bank 1 and the other is Bank 2, and the code points you to the lean side.
Kelley Blue Book says P0171 almost always comes with at least one other code, P0170, so don't be surprised to see both.
Common causes of P0171
The top cause is air sneaking into the engine without being counted. Most often this is a vacuum leak, meaning a crack or opening that pulls outside air into the engine downstream of where airflow gets measured. That measuring device is the mass airflow sensor, which reports incoming air to the computer.
These are the usual suspects:
- A cracked or loose PCV (engine vent) hose, or a PCV valve that has failed
- A failed gasket on the intake manifold or throttle body, which can cause a large leak
- A mass airflow sensor that's dirty or not working right
- A fuel pump that's losing strength, a blocked pump strainer, or a failing fuel pressure regulator, each of which can lower fuel pressure
- Fuel injectors that are weak, blocked, or misfiring
- A fuel filter that's clogged or dirty
A blocked injector or a dirty fuel filter can happen but is rare, per Olathe Toyota's parts site.
How to track down and fix a P0171
It pays to check the simple things first.
- Start by cleaning the mass airflow sensor and the hoses around it. Olathe Toyota's parts site says this is usually the best first fix.
- Check all the PCV hoses for splits or leaks, as AutoZone suggests, and check the PCV valve too.
- Inspect the intake hoses plus the region near the intake manifold and throttle body for any vacuum leaks.
- If you find no leak, a fuel pressure test may help, since a weak pump, clogged pump strainer, or faulty pressure regulator can leave the engine short of fuel.
- Fuel injectors and the fuel filter are also possible causes, though Olathe Toyota's parts site calls them rare.
Is it safe to keep driving with P0171?
The car usually still runs, but continuing to drive with this code is strongly not recommended. If the engine starts pinging (a knocking sound), the lean mix can overheat the catalytic converter and damage it.
Repair costs
What you pay depends on what's causing the lean mix. Vdiagtool's estimate, in US dollars, looks like this:
| Fix | Ballpark price |
|---|---|
| Air filter | Less than $50 |
| Fuel pump or sensor | A few hundred dollars and up |
P0171 and the emissions test
A lot of states run an OBD plug-in test, which pulls data from your car's computer rather than testing the exhaust itself. A lit check engine light fails an OBD test, so P0171 has to be resolved first.
Every state that tests exempts electric cars. As of 2026, 27 states plus Washington, D.C. operate emissions testing in some or all areas. If your car still fails after repairs, certain states grant a waiver after you've put a certain dollar amount into emissions-related repairs. New York, for instance, sets that amount at $450 and Illinois at $1,176.
Questions people often ask
Do I need to replace the oxygen sensor first?
Usually not. Swapping the oxygen sensor or air-fuel sensor first is the mistake people make most often with this code. In most cases the sensor is only reporting a lean mix that has a different root cause.
Will I feel anything different while driving?
Often you won't. Plenty of cars with P0171 drive exactly the same as before, and the check engine light may be the only sign.
What does it mean when P0174 appears as well?
P0174 is the matching lean code, but for Bank 2. P0171 often shows up together with P0174, which means the computer has also found a lean mix on Bank 2.
What air-to-fuel mix should the engine have?
The engine wants 14.7 parts air for every 1 part fuel. P0171 means the balance has tipped in the direction of extra air.
Is it okay to clear the code right before the test?
Clearing the codes can leave the car's self-checks unfinished, so it may not be ready for an emissions test even if the warning light is off. If you've driven under about 200 miles since clearing, those checks usually aren't done.
Most states permit just 1 incomplete check on 2001 and newer cars, and 2 on cars from 1996 to 2000. And if the underlying problem wasn't fixed, the code will probably return.