Go-Parts
Cart 0
Your cart is empty
Add an item to see it appear here.
Wrenchy
Go-Parts Garage
Expert guides for diagnosing, troubleshooting, and replacing auto parts Expert guides for diagnosing and replacing auto parts
Browse All Articles →
🧭 Diagnostic Flowchart 🎬 Helpful Videos 🛍️ Shop This Part

P0171 on 2004-2009 Toyota Prius: Lean Code Causes and Fixes

For a 2004-2009 Prius, code P0171 is most often caused by a dirty or faulty Mass Air Flow (MAF) sensor. Cleaning the sensor with a dedicated cleaner is a common, inexpensive first step. If that doesn't work, suspect a vacuum leak from a bad intake manifold gasket or a cracked PCV hose. Check fuel trims with a scan tool; high positive trims at idle that normalize at higher RPM strongly indicate a vacuum leak.

19 minutes to read 2004-2009 Toyota Prius
Most Likely Cause
Dirty or Faulty Mass Air Flow (MAF) Sensor
Difficulty
2/5
Est. Time
1.1 hrs
DIY Doable?
✅ Yes
Shop Labor
$50 – $450
Parts Price
$10 – $200
⚠️ Drivable, but... — You can drive, but it's not recommended for extended periods. A lean condition can cause hesitation, poor fuel economy, and potentially higher combustion temperatures, which may lead to engine damage or catalytic converter failure over time.
Key Takeaways
  • Start with the cheapest and easiest fix: clean the Mass Air Flow (MAF) sensor with dedicated cleaner.
  • If cleaning the MAF doesn't work, your next step is to check for vacuum leaks, paying close attention to the intake manifold gasket and PCV hoses.
  • Do not replace the oxygen (A/F) sensor first; it is almost always just reporting the lean condition correctly.
  • A scan tool that can read live fuel trim data is extremely helpful in diagnosing whether the issue is a vacuum leak or a fuel delivery/MAF problem.
The code P0171 stands for "System Too Lean (Bank 1)". This means the engine's computer (ECM) has detected too much air and not enough fuel in the air-fuel mixture. The ECM uses an Air/Fuel Ratio sensor (an upstream oxygen sensor) to monitor the exhaust gases. When the sum of its short-term (STFT) and long-term (LTFT) fuel trim adjustments exceeds a positive threshold (e.g., +33%) for a sustained period to compensate for excess air, it triggers the P0171 code and the Check Engine Light. Since the 1NZ-FXE is an inline 4-cylinder engine, it only has one bank, so you won't see the corresponding P0174 code for Bank 2.

What's Unique About the 2004-2009 Toyota Prius

On the second-generation Prius, the P0171 code is very frequently linked to a dirty Mass Air Flow (MAF) sensor. The sensor's delicate wires can become contaminated with a black film over time, causing it to under-report the amount of air entering the engine. Another common issue on high-mileage 1NZ-FXE engines is vacuum leaks, particularly from aged intake manifold gaskets and PCV hoses, which introduce unmetered air and lead to a lean condition.

Symptoms You May Notice

  • Check Engine Light is on
  • Reduced fuel economy
  • Rough or unstable idle
  • Hesitation or stumbling during acceleration
  • Engine misfires (may be accompanied by P0300, P0301, etc.)
  • Possible stalling at low RPM
⚠️ Don't Waste Money on the Wrong Fix
  • Replacing the Air/Fuel Ratio (Oxygen) Sensor. The A/F sensor is usually just accurately reporting the lean condition, not causing it. Replacing it is an expensive step that rarely fixes a P0171 code unless accompanied by a specific sensor fault code.

Most Likely Causes

  1. Dirty or Faulty Mass Air Flow (MAF) Sensor 🔴 High Probability → Shop Fuel Injection Air Flow Meter The MAF sensor on this platform is highly sensitive to dirt and oil buildup, which insulates the sensor's hot wire and causes it to report less airflow than is actually entering the engine. This is the most common cause cited by owners and mechanics, and cleaning it is the recommended first step.
    How to confirm: Visually inspect the sensor wires inside the MAF housing; they should be amber-colored, not coated in black grime. A scan tool can monitor MAF sensor readings (g/s); values should be around 1.5-3.0 g/s at idle and increase smoothly with RPM. If cleaning doesn't work, replacement may be necessary.
    Typical fix: Remove the sensor (two Phillips head screws) and clean it carefully with a dedicated MAF sensor cleaner spray. 🎬 Watch: How to safely remove and clean your MAF sensor. Do not touch the delicate sensor wires. Allow it to air dry completely before reinstalling.
    Est. part cost: $10-$15 for cleaner, $60-$150 for a new Denso sensor
  2. Vacuum Leak (Intake Manifold Gasket, PCV Hose) 🟡 Medium Probability With age and heat cycles, rubber and plastic components like the intake manifold gasket and PCV hoses can become brittle, crack, or flatten, allowing unmetered air to enter the engine after the MAF sensor. The intake manifold gasket is a particularly common failure point.
    How to confirm: Use a scan tool to observe fuel trims. A classic sign of a vacuum leak is a high Long Term Fuel Trim (LTFT) at idle (e.g., +20% or higher) that decreases significantly as RPMs increase to 2500-3000. A smoke test is the most definitive way to locate a leak. 🎬 See how a professional smoke test identifies hidden vacuum leaks. A less precise method is to carefully spray brake cleaner around the intake manifold area with the engine running; a change in engine RPM indicates a leak.
    Typical fix: Replace the failed gasket or hose. The intake manifold gasket is a common DIY repair.
    Est. part cost: $15-$50
  3. Clogged or Dirty Fuel Injectors ⚪ Low Probability → Shop Fuel Injector Over time, deposits can restrict fuel flow through the injectors, preventing them from delivering the commanded amount of fuel. This causes the ECM to compensate by increasing fuel trims, eventually triggering P0171.
    How to confirm: This is typically diagnosed after ruling out MAF and vacuum leaks. If LTFT is high across all RPM ranges and does not decrease significantly at higher speeds, it points away from a vacuum leak and towards a fuel delivery issue. One owner on PriusChat fixed a stubborn P0171 with a LTFT of 32.8% by replacing clogged injectors, which brought the trim down to 2-3%.
    Typical fix: Run a high-quality fuel system cleaner (e.g., with PEA) through the tank as a first step. If that fails, the injectors may need to be professionally cleaned or replaced.
    Est. part cost: $20 for cleaner, $200-$400 for a set of injectors

Rare But Worth Checking

  • Low Fuel Pressure / Weak Fuel Pump: → Shop Fuel Pump While less common, a failing fuel pump can cause a P0171 code if it cannot supply enough fuel to the engine. This is usually considered after the more common causes (MAF, vacuum leaks) have been ruled out. Several owners have fixed the code by replacing the fuel pump after trying all other solutions.
  • Stuck or Faulty PCV Valve: → Shop PCV Valve The PCV (Positive Crankcase Ventilation) valve can get stuck open, creating a constant vacuum leak. Hoses connected to it can also crack. A good valve should rattle when shaken. 🎬 Watch this walkthrough for replacing the PCV valve and accessing sensors. It's an inexpensive part and often replaced as preventative maintenance.
  • Exhaust Leak Before A/F Sensor: A crack or leak in the exhaust manifold or a bad gasket before the primary Air/Fuel ratio sensor can allow oxygen to be pulled into the exhaust stream, fooling the sensor into thinking the engine is running lean.

Technical Service Bulletins (TSBs) & Recalls

  • TSB Bulletin #T-SB-0041-15: A manufacturer service bulletin notes that a P0171 code may set alongside P3190 (Poor Engine Power) or P3191 (Engine Does NOT Start). The bulletin suggests replacing the Purge VSV (Vacuum Switching Valve Assembly) and reprogramming the Engine Control Module (ECM).

Diagnosis Steps

  1. Read the code with an OBD-II scanner. Note the Long Term Fuel Trim (LTFT) and Short Term Fuel Trim (STFT) values at idle and at 2,500 RPM. A total trim (LTFT + STFT) consistently above +25% indicates a problem, with the code setting around +33%.
  2. Visually inspect the engine bay for obvious signs of a vacuum leak, such as cracked, disconnected, or collapsed hoses, particularly around the intake manifold and PCV system.
  3. Remove and inspect the Mass Air Flow (MAF) sensor, located on the air filter housing. If it appears coated in black grime, clean it with dedicated MAF sensor cleaner and allow it to dry completely before reinstalling.
  4. Clear the codes, disconnect the 12V battery for a few minutes to reset fuel trims, and drive the vehicle to see if the light returns.
  5. If the code returns, analyze the fuel trims. If LTFT is high at idle but drops toward 0% at 2,500 RPM, you almost certainly have a vacuum leak.
  6. To find a vacuum leak, perform a smoke test. Alternatively, carefully spray short bursts of a combustible cleaner around the intake manifold gasket and vacuum hose connections with the engine running. If the engine RPM changes or STFT drops sharply, you have found the leak's location.
  7. If fuel trims are high at both idle and cruising speeds, the issue is more likely the MAF sensor, clogged fuel injectors, or low fuel pressure.
  8. Test the PCV valve by removing and shaking it; it should rattle. If stuck, replace it.
  9. If other causes are ruled out, test the fuel pressure to check for a weak fuel pump or consider having the fuel injectors professionally cleaned/tested.

Parts You'll Likely Need

  • Mass Air Flow (MAF) Sensor (OEM #22204-22010) — This is the most frequent cause of P0171 on the Gen 2 Prius. It often only needs cleaning, but replacement is common on high-mileage vehicles. Owners strongly recommend using the OEM Denso part to avoid issues with aftermarket sensors.
    Trusted brands: Denso (OEM)
    OEM price range: $120-$180
    Aftermarket price range: $60-$110
  • Intake Manifold Gasket (OEM #17171-21020) — These gaskets can become brittle and fail over time, creating a significant vacuum leak that is a well-documented cause of P0171.
    Trusted brands: Toyota (OE), Fel-Pro
    OEM price range: $15-$25
    Aftermarket price range: $5-$15
  • PCV Valve (OEM #12204-21011) — A cheap and easy-to-replace part that can get stuck open and act as a vacuum leak. Also a contributor to oil consumption when faulty.
    Trusted brands: Toyota (OE)
    OEM price range: $8-$15
    Aftermarket price range: $5-$10

Related Codes That Often Appear With This One

  • P0300, P0301, P0302, etc. — A severe lean condition can cause the air-fuel mixture to fail to ignite properly, leading to random (P0300) or cylinder-specific (P030x) misfires.

Mechanic-Grade Diagnostic Values

  • Fuel Pressure — expected: 304 to 343 kPa (44.1 to 49.7 psi). Failure: Pressure below 304 kPa indicates a weak pump or clogged filter. Pressure should also hold above 147 kPa (21 psi) for 5 minutes after the engine is stopped.
  • Fuel Injector Resistance — expected: 11.6 to 12.4 Ω at 20°C (68°F). Failure: Resistance outside this range indicates a faulty injector coil.
  • A/F Sensor Voltage (via OBD-II Scan Tool) — expected: Fluctuates around 3.3 V at idle and 2,500 RPM.. Failure: Voltage stuck high (e.g., >3.8V) or low (e.g., <2.8V), or not fluctuating, can indicate a sensor fault, but this should be diagnosed after checking for leaks and fuel delivery issues.
  • Long Term Fuel Trim (LTFT) + Short Term Fuel Trim (STFT) — expected: Within +/- 10% of zero.. Failure: A combined value consistently over +25% indicates a significant lean condition. The P0171 DTC typically sets when the value exceeds +33%.

Scan Tool Commands That Help

  • Toyota Techstream: ACTIVE TEST / A/F CONTROL — This function allows a technician to manually command the ECM to increase (+25%) or decrease (-12.5%) the fuel injection volume. By observing the A/F and O2 sensor responses, a technician can determine if the sensors are reacting correctly and if the fuel system is capable of adjusting the mixture, which helps isolate the fault between sensors and other components.
  • Toyota Techstream: Data List > AFS B1S1 and O2S B1S2 — This allows for real-time graphing of the upstream Air/Fuel sensor and the downstream Oxygen sensor. A healthy A/F sensor will show voltage fluctuating around 3.3V, while the downstream O2 sensor should be relatively stable. This is critical for visually confirming sensor activity after checking for leaks and fuel pressure.

Wiring & Ground Locations

  • EC, ED, EE, EF — These are ground points for the Engine Wire harness, located on the engine block and transmission housing on the driver's side of the engine bay.. The MAF sensor, A/F sensor, and other critical engine sensors share these ground paths. A corroded or loose ground at these points can introduce voltage offsets and erratic signals, mimicking sensor failure and potentially causing a P0171 code.
  • Engine Control Module (ECM) — Located behind the right side of the dashboard/glove box area.. The ECM is the termination point for sensor wiring. Knowing its location is necessary for any advanced pin-out testing of the MAF or A/F sensor circuits to check for continuity or shorts in the harness.
  • MAF Sensor Connector Pins — On the MAF sensor itself, at the airbox.. For advanced diagnostics, you can test for voltage at the connector. With the key on, you should find battery voltage between +B and E2G pins. The VG pin is the signal wire to the ECM.

Real Owner Repair Stories

  • PriusChat user 'lexibothersme' (2010 Toyota Prius (Gen 3, but relevant process), 147,800 miles) — P0171 Check Engine Light.
    ❌ Tried (didn't work) Replacing MAF sensor, Replacing spark plugs, Replacing Air/Fuel sensor, Cleaning intake manifold, Replacing PCV valve, Replacing downstream O2 sensor
    ✅ What actually fixed it Replacing the fuel pump assembly. A dealer first misdiagnosed it as a cracked intake manifold, but the code returned, and they later determined the fuel pump was weak.
  • YouTube user 'G's Garage' (Toyota Prius C / Aqua (Similar 1NZ-FXE family)) — P0171 System Too Lean, misfire, rough idle.
    ❌ Tried (didn't work) Owner had previously taken it to other shops who tried replacing coils and plugs.
    ✅ What actually fixed it A smoke test revealed a significant vacuum leak from a crack in the plastic intake manifold itself, between cylinders 2 and 3, not from the gasket. The entire intake manifold had to be replaced.

"I Checked Everything" — The Actual Cause

  • In several documented cases, owners passed or skipped a smoke test and replaced multiple components (MAF, O2 sensors) only to find the root cause was a weak fuel pump unable to provide adequate pressure. This is a classic scenario where fuel trims are high across all RPMs, but a vacuum leak is incorrectly assumed to be the only cause. A fuel pressure test is the definitive diagnostic step in this situation.

When the Usual Fixes Don't Work

  • While cleaning the MAF sensor is the most common fix, it's important to note that if fuel trims are high at idle and drop significantly at higher RPM, the problem is almost certainly a vacuum leak, not the MAF. Technicians often see owners replace the MAF sensor when the fuel trim data clearly points to a vacuum leak from a hardened intake gasket or cracked PCV hose. Conversely, if fuel trims are high across all engine speeds and loads, the MAF sensor is a strong suspect, but so is a weak fuel pump. A fuel pressure test should be performed before replacing expensive parts if a new MAF or cleaning the old one yields no improvement.

OEM Part Supersession History

  • 17171-2102017177-21020 — Standard part revision and consolidation by Toyota.
    Heads up: The part number for the intake manifold gasket was changed from 17171-21020 to 17177-21020. They are functionally identical and fully interchangeable for this application.

Diagnostic Flowchart

Other Known Issues on This Vehicle

Issues unrelated to this code that are worth knowing about as an owner of this generation:

  • Combination Meter (Dashboard) Failure 🔴 High — Very common. The display for the speedometer and fuel gauge goes dark intermittently or permanently. Often caused by a failed capacitor on the circuit board. (Ref: A warranty extension program was issued, but has since expired. Repair involves replacing the board or having a technician replace the faulty capacitor.)
  • Inverter Coolant Pump Failure 🔴 High — Extremely common. The electric pump that cools the hybrid inverter fails, triggering a master warning light and DTC P0A93. Failure can lead to the hybrid system shutting down. (Ref: Subject of Toyota Safety Recall E0E (NHTSA #12V536000) and a Limited Service Campaign (LSC-90K) for 2004-2007 models. The updated part has a silver mount instead of the original black one.)
  • Brake Actuator Assembly Failure 🔴 High — A frequent and costly failure. The ABS/brake actuator fails internally, causing a loud, repetitive pumping noise and illumination of multiple brake-related warning lights. (Ref: Toyota issued Warranty Enhancement Program ZG1, extending coverage to 10 years/150,000 miles, but this has expired for most vehicles.)
  • Excessive Oil Consumption 🟠 Medium — Common on high-mileage (150k+) engines. Can be caused by a stuck PCV valve or, more often, carbon buildup on low-tension piston rings.
  • HID Headlight Failure 🟡 Low — Common for models equipped with High-Intensity Discharge headlights. The bulbs or ballasts can fail prematurely.

Used vs. New Parts: Buying Guide for This Vehicle

When a used part is the smart pick: For this repair, a used MAF sensor or intake manifold from a reputable salvage yard can be a cost-effective option. Fuel pumps are also viable if from a low-mileage donor. Small items like gaskets and PCV valves should always be purchased new.

Donor-vehicle mileage cap: roughly under 80000 miles for the part to have meaningful remaining life.

What to inspect on the donor part:

  • For a MAF sensor, ensure the donor vehicle was not in a front-end collision that could have damaged the airbox.
  • For an intake manifold, inspect it carefully for any hairline cracks, especially around mounting points and injector ports.
  • Check the reported mileage of the donor vehicle; lower is always better for electronic and fuel system components.
  • Ask about the salvage yard's return policy in case the part is non-functional.

OEM-only on this vehicle (don't cheap out):

  • Mass Air Flow (MAF) Sensor

Aftermarket brands forum-validated for this vehicle:

  • Denso (for MAF sensor, as it's the OEM supplier)
  • Fel-Pro (for intake manifold gasket)

Brands owners have reported issues with on this vehicle:

  • Unknown, no-name MAF sensors from eBay or Amazon. Forum users consistently report that cheap aftermarket MAF sensors are often dead-on-arrival or fail quickly, causing more diagnostic headaches. Sticking with OEM Denso is highly recommended.

Real Owner Stories

Aggregated from forums and TSBs cited above. Mileages and costs reflect what owners reported in those sources.

2004-2009 Toyota Prius 1.5L

Symptoms: The owner observed a very high Long Term Fuel Trim (LTFT) stuck at 32.8%. They attempted to fix it by replacing the A/F sensor and the ECM, but the code persisted.

What fixed it: Replacing clogged fuel injectors, which brought the fuel trims back down to a normal range of 2-3%.

Source hint: PriusChat: P0171 code (LTFT stuck at 32.8%)

2010 Toyota Prius (Gen 3)

Symptoms: The owner performed an exhaustive diagnostic process including replacing the MAF, A/F sensor, O2 sensor, and cleaning the intake manifold.

What fixed it: Replacing a weak fuel pump.

Source hint: PriusChat: P0171 System Too Lean fixed on 2010 Prius

2004-2009 Toyota Prius 1.5L

Symptoms: The owner experienced a P0171 System Too Lean (Bank 1) code and inspected the MAF sensor, finding it coated in black grime.

What fixed it: Cleaning the MAF sensor with dedicated cleaner; the owner provided photos showing the grime removal and confirmed the code did not return.

Source hint: PriusChat: P0171 System Too Lean (Bank 1) - MAF Cleaning

Frequently Asked Questions

Is there a recall for the inverter coolant pump on my 2004-2007 Prius that might be related to my warning lights?
Yes, 2004-2007 models were subject to Toyota Safety Recall E0E (NHTSA #12V536000) and Limited Service Campaign LSC-90K for the inverter coolant pump. While this typically triggers code P0A93 rather than P0171, it is a critical common failure for this platform.
My 2004-2009 Prius dashboard display went dark; is this related to the P0171 lean code?
No, the dark dashboard (speedometer and fuel gauge) is a separate known issue called Combination Meter Failure, often caused by a failed capacitor. Toyota issued a warranty extension for this, though it has since expired.
What are the specific MAF sensor readings I should look for on my 1NZ-FXE engine to confirm a P0171?
Using a scan tool, you should see MAF sensor values between 1.5-3.0 g/s at idle. The values should increase smoothly as you increase the RPM. If the sensor wires appear black instead of amber, cleaning is required.
Can I use any cleaner to fix the MAF sensor on my Prius?
No, you must use a dedicated MAF sensor cleaner spray. You should never touch the delicate sensor wires directly. Allow it to air dry completely before reinstalling to avoid damage.
Is the intake manifold gasket a common failure point for the P0171 code on this generation?
Yes, on the 2004-2009 Prius, the intake manifold gasket is a common failure point because the rubber becomes brittle or flattens over time due to heat cycles, allowing unmetered air to enter.
How can I tell if my P0171 is a vacuum leak or a fuel delivery issue using fuel trims?
If the Long Term Fuel Trim (LTFT) is high at idle but decreases significantly at 2,500-3,000 RPM, it is likely a vacuum leak. If the LTFT remains high across all RPM ranges, it points toward a MAF sensor or fuel delivery issue like clogged injectors.
Removing and Cleaning A Prius Mass Air Flow Sensor
Removing and Cleaning A Prius Mass Air Flow Sensor
P0171 / P0174  - 2001 Toyota Prius 1.5L Smoke Test
P0171 / P0174 - 2001 Toyota Prius 1.5L Smoke Test
How to Replace a PCV Valve - with MAF and Spark Plug Access (Toyota Prius)
How to Replace a PCV Valve - with MAF and Spark Plug Access (Toyota Prius)
03 04 05 06 07 08 Toyota Corolla Matrix P0171 Intake Manifold Gasket TSB
03 04 05 06 07 08 Toyota Corolla Matrix P0171 Intake Manifold Gasket TSB
Wrenchy
Article researched & written by
Go-Parts' AI research assistant. Every article is backed by live web research, verified OEM data, and real technician knowledge — so you get accurate, up-to-date information you can trust.
Meet Wrenchy → Updated May 30, 2026

The information in this article is provided for general reference and educational purposes only. Vehicle specifications, procedures, and part compatibility can vary by production date, trim level, and region. Always consult your vehicle's factory service manual and verify part numbers before purchasing or performing repairs. Safety-critical components such as airbags, seat belts, and braking systems should be installed by a qualified professional.

Year Coverage
This article covers the OBD-II Code P0171 (Deep Dive) for:
  • Toyota Prius: 200420052006200720082009
In this article
🧭 Diagnostic Flowchart
Jump to ▴

Email This Guide

We'll send you a link to this article so you can read it later or share it.

Added to cart · Part