P0171 on 2019-2023 Mazda MAZDA3: Causes for System Too Lean Code
On a 2019-2023 Mazda3, code P0171 means the engine is running lean. While common causes like vacuum leaks or a dirty MAF sensor should be checked, a widespread Mazda Technical Service Bulletin (TSB MT-021/17) points to faulty fuel injectors as a likely root cause if initial inspections don't solve the problem. Some owners have also resolved the issue by replacing the purge control solenoid valve.
- P0171 means your Mazda3's engine has too much air or too little fuel.
- Always check for simple issues first: ensure the air filter and housing are sealed correctly and inspect for obvious cracked vacuum hoses.
- Cleaning the Mass Airflow (MAF) sensor is a cost-effective diagnostic step.
- If simple checks and cleaning the MAF sensor don't fix it, the problem is likely more serious.
- A Mazda TSB strongly suggests that faulty fuel injectors are a known issue on these engines and may be the required fix.
What's Unique About the 2019-2023 Mazda MAZDA3
While many vehicles with a P0171 code suffer from vacuum leaks or dirty MAF sensors, Mazda has issued a specific and widely applicable Technical Service Bulletin (MT-021/17) for all its SKYACTIV models, including the 2019-2023 Mazda3. The bulletin outlines a clear diagnostic path: after checking the air intake, MAF sensor, and A/F sensor, it directs technicians to replace the fuel injectors as the definitive repair. This strongly suggests that failing fuel injectors are a more common and officially recognized problem on this platform than one might typically assume for a lean code.
Diagnostic Flowchart

Tap your situation to follow the diagnostic path that matches what you're seeing on this vehicle.
Symptoms You May Notice
- Check Engine Light is on
- Rough or unstable idle
- Engine hesitation or lack of power during acceleration
- Engine stalling, especially at idle or at a stop
- Possible misfires, which may trigger P030X codes
- Hard starting immediately after refueling
- Whistling or hissing noise from the engine bay, indicating a vacuum leak
- Bouncing or high tachometer reading at idle
- Replacing the oxygen sensor without first checking for vacuum leaks or a dirty MAF sensor. The O2 sensor is often correctly reporting the lean condition, not causing it.
- Replacing the MAF sensor or A/F sensor when the root cause is actually the fuel injectors, as highlighted by Mazda's TSB.
Most Likely Causes

- Vacuum Leak 🔴 High Probability Vacuum leaks are a common cause of lean codes on all modern vehicles. Hoses can become cracked or disconnected, and gaskets (like the intake manifold or throttle body gasket) can fail over time. A loose air filter housing can also be a culprit. A partially disconnected brake booster vacuum line has been identified as a specific source of a major vacuum leak.
How to confirm: Perform a visual inspection of all vacuum hoses connected to the intake manifold. Listen for hissing sounds with the engine running. The most effective method is to use a smoke machine to introduce smoke into the intake system and watch for where it escapes. A less precise method involves carefully spraying propane or a non-flammable brake cleaner around suspected areas and listening for a change in engine RPM.
Typical fix: Replace the cracked hose, leaking gasket (e.g., intake manifold gasket), or improperly connected component.
Est. part cost: $10-$150 - Faulty or Dirty Mass Airflow (MAF) Sensor 🔴 High Probability → Shop Fuel Injection Air Flow Meter
How to confirm: A dirty MAF sensor under-reports the amount of air entering the engine, causing the PCM to command too little fuel. Inspect the sensor element for dirt or debris. You can try cleaning it with a dedicated MAF sensor cleaner; do not use other chemicals like carb cleaner. If cleaning doesn't work, the sensor may need replacement. A Reddit user with a 2021 Mazda3 hatch reported a faulty MAF sensor was the cause of their P0171 code.
Typical fix: Clean the MAF sensor with a specialized cleaner. If the problem persists, replace the MAF sensor.
Est. part cost: $100-$250 - Faulty Fuel Injectors 🟡 Medium Probability → Shop Fuel Injector Mazda TSB MT-021/17 specifically identifies replacing the fuel injectors as the final repair step if other diagnostics do not resolve the lean condition. This indicates a known issue with injectors on Skyactiv engines becoming clogged or failing. One Reddit user reported a dealer quote of over $3,000 to replace them. Another owner of a 2018 model with 70k miles was also quoted for fuel injector replacement after other parts failed to fix the code.
How to confirm: This is typically diagnosed after ruling out vacuum leaks and sensor issues, as per the TSB. A professional may perform a fuel injector balance test. Given the TSB, if fuel trims remain high after other checks, faulty injectors are the likely culprit. An electrical test with a multimeter should show a resistance between 12-17 ohms; readings outside this range indicate a failed injector. 🎬 Watch this walkthrough on replacing fuel injectors to fix lean codes.
Typical fix: Replace the fuel injectors, typically as a set.
Est. part cost: $400-$800 - Faulty Front Air/Fuel Ratio Sensor (Oxygen Sensor) 🟡 Medium Probability → Shop Oxygen Sensor
How to confirm: The A/F sensor (O2 sensor) can become slow or biased, sending incorrect lean readings to the PCM. A diagnostic scan tool can be used to graph the sensor's voltage to see if it is responding correctly. It's a key inspection point in TSB MT-021/17 before condemning the fuel injectors.
Typical fix: Replace the front Air/Fuel ratio sensor (Bank 1, Sensor 1).
Est. part cost: $150-$300 - Stuck-Open Purge Control Solenoid Valve ⚪ Low Probability → Shop Vapor Canister Purge Solenoid A purge valve stuck open creates a vacuum leak by allowing unmetered fuel vapor from the charcoal canister into the intake manifold at the wrong time. A key symptom is difficulty starting the engine immediately after refueling. One 2019 Mazda3 owner on Reddit fixed their P0171 code and stalling issues simply by replacing this valve after a dealership misdiagnosed other issues.
How to confirm: With the engine off, disconnect the hose leading from the valve to the intake manifold and try to blow through it; no air should pass. With the engine running, disconnect the electrical connector and check for vacuum on the port leading to the intake manifold; there should be none until the engine is warm and the ECU commands it open. On a scan tool, the EVAPCP duty cycle should be 0% at idle. 🎬 See how to perform a simple test on your purge solenoid.
Typical fix: Replace the purge control solenoid valve. The Mazda OEM part number is PE01-18-751.
Est. part cost: $50-$100
Rare But Worth Checking
- Weak Fuel Pump: → Shop Fuel Pump While less common on newer vehicles, a failing fuel pump can deliver insufficient fuel pressure, leading to a lean condition. This would require a fuel pressure test to diagnose. One owner of a 2018 model ultimately traced their issues to a faulty high-pressure fuel pump that required OEM replacement.
Diagnosis Steps

- Read Codes & Check Fuel Trims: Use an OBD-II scanner to confirm P0171 and any other codes. 🎬 Watch: A step-by-step guide to troubleshooting P0171 on a Mazda 3. View live data for Short-Term (STFT) and Long-Term Fuel Trim (LTFT). A combined total consistently above +25% confirms a significant lean condition.
- Follow Mazda TSB MT-021/17 Procedure: Mazda provides a specific diagnostic order.
- Inspect Intake System: Per the TSB, first check that the air filter is clean and the airbox/intake ducting is properly sealed and has no cracks. An improperly seated air filter gasket has been reported as a cause.
- Inspect for Vacuum Leaks: Visually inspect all vacuum hoses for cracks or disconnection. Use a smoke machine for a definitive test. Pay attention to the intake manifold gaskets and the brake booster hose.
- Clean and Test MAF Sensor: Per the TSB, inspect the MAF sensor. Remove and clean it with dedicated MAF sensor cleaner. Reinstall and check if fuel trims improve.
- Test A/F Sensor: Per the TSB, inspect the front Air/Fuel (oxygen) sensor's performance via live data to ensure it is switching correctly and not biased.
- Test Purge Control Solenoid Valve: Check if the valve is stuck open, as this is a known cause. A common symptom is a hard start after refueling.
- Replace Fuel Injectors: If all previous steps do not resolve the high positive fuel trims, the issue is highly likely to be the fuel injectors, as per the final step in Mazda TSB MT-021/17.
- Check Fuel Delivery: If the cause is still not found, test fuel pressure to rule out a weak fuel pump or clogged filter.
Parts You'll Likely Need
- Fuel Injector Set
(OEM #PYFA-13-250A, PY01-13-250)— Identified by Mazda TSB MT-021/17 as the likely repair if initial checks for vacuum leaks and faulty sensors do not resolve the issue. Multiple forum users confirm this was the dealer-recommended fix.
Trusted brands: Mazda OE
OEM price range: $600-$800
Aftermarket price range: $400-$600 - Mass Airflow (MAF) Sensor — A common cause of incorrect air measurement leading to lean codes. Cleaning is often a first step, but replacement may be necessary.
Trusted brands: Denso, Bosch, Hitachi
OEM price range: $200-$300
Aftermarket price range: $100-$180 - Purge Control Solenoid Valve
(OEM #PE01-18-751)— Can get stuck open, creating a vacuum leak. A known, simple fix that has resolved P0171 for some owners.
Trusted brands: Mazda OE
OEM price range: $60-$90
Aftermarket price range: $40-$70 - Air/Fuel Ratio Sensor
Related Codes That Often Appear With This One
- P0300, P0301, P0302, etc. — A severe lean condition can lead to misfires in one or more cylinders. Mazda's TSBs MT-021/17 and MT-004-22 specifically note that P0171 may appear with P030X misfire codes.
- P0507 — Idle Air Control System RPM Higher Than Expected. A vacuum leak that causes P0171 can also cause the engine idle speed to be too high, triggering P0507. One owner reported both codes appearing simultaneously.
Technical Service Bulletins (TSBs) & Recalls
- MT-021/17: Provides the detailed repair procedure for P0171 on all Skyactiv engines, culminating in the replacement of fuel injectors if initial checks of the intake, MAF, and A/F sensor do not resolve the issue.
- MT-004-22: Notes that some vehicles may experience Check Engine Light with DTC P0171 (Fuel Trim too Lean) and possibly P030X (Misfire), and directs technicians to a specific inspection/repair procedure.
Platform-Specific Known Issues
- A Technical Service Bulletin (MT-021/17) exists for a wide range of Mazda vehicles with Skyactiv engines, including the 2019-2023 Mazda3. It provides a clear diagnostic flow for P0171: 1) Inspect intake/air filter, 2) Inspect MAF sensor, 3) Inspect A/F sensor. If fuel trims remain abnormal after these checks, the bulletin's final step is to 'Replace the fuel injectors'.
Mechanic-Grade Diagnostic Values
- Mass Airflow (MAF) Sensor Reading at Idle — expected: Approximately 1.6 to 2.2 g/s for a 2.0L/2.5L engine. General range for most engines is 2 to 7 g/s.. Failure: Readings significantly lower than expected suggest unmetered air (vacuum leak), while erratic or dropping signals can indicate a faulty sensor.
- Mass Airflow (MAF) Sensor Reading at 2500 RPM — expected: Should rise to between 15 to 25 g/s, depending on engine size.. Failure: A non-linear or flat response when raising RPM indicates a failing MAF sensor.
- Low-Pressure Fuel System Hold Pressure — expected: 230 kPa {2.35 kgf/cm2, 33.4 psi} or more after the engine is stopped.. Failure: Pressure dropping below 230 kPa indicates a potential leak in the fuel line or a faulty fuel pump check valve.
- Fuel Injector Coil Resistance — expected: Typically 12-17 ohms for Mazda models.. Failure: A reading outside this range (e.g., open circuit or short) indicates the injector's electrical coil has failed and the injector must be replaced.
- EVAP Purge Commanded (EVAPCP) Duty Cycle at Idle — expected: 0% when the engine is at idle.. Failure: A value greater than 0% at idle (e.g., 15%) suggests the PCM is commanding the purge valve open when it should be closed, or the valve is stuck open, creating a vacuum leak.
Real Owner Repair Stories
- MorFab Industries YouTube Channel (2009 Mazda 3, 160k miles) — Check Engine Light with code P0171. Long Term Fuel Trim at +20% and total corrected trim at +35%.
❌ Tried (didn't work) Initial visual inspection did not reveal the leak.
✅ What actually fixed it A smoke test revealed a massive vacuum leak from the brake booster vacuum line, which was found to be 3/4 of the way unplugged from the booster itself. Reconnecting the hose brought fuel trims back into a more acceptable range. - Reddit user in r/mazda3 (2018 Mazda 3, 70k miles) — Initially rough idle and no-start, fixed with an OEM high-pressure fuel pump. Shortly after, a P0171 code appeared with no other symptoms.
❌ Tried (didn't work) Replacing the high-pressure fuel pump with an aftermarket part., Replacing the MAF sensor (twice, once with aftermarket, once with OEM)., Replacing the A/F ratio sensor.
✅ What actually fixed it The initial no-start was fixed by replacing a faulty high-pressure fuel pump with an OEM part. The subsequent P0171 code was not resolved in the thread, but the final shop recommendation, consistent with the Mazda TSB, was to replace all four fuel injectors for $3,500. - ScannerDanner Forum user (2014 Mazda 3) — P0171 with Long Term Fuel Trim at +20.5% at idle.
❌ Tried (didn't work) Replaced upstream O2 sensor., Replaced MAF sensor., Repaired exhaust leaks., Visually inspected for vacuum leaks (no smoke test initially).
✅ What actually fixed it The user reported that the issue was resolved by using a fuel system cleaner (Amsoil PI performance additive), which suggests the root cause was dirty or partially clogged fuel injectors.
"I Checked Everything" — The Actual Cause
- In one documented case for a similar model year, a user performed multiple checks including a smoke test which came back negative. The final resolution was using a strong fuel injector cleaner, which solved the high fuel trim and P0171 code, pointing to dirty/clogged injectors as the root cause that a smoke test would not find.
- A faulty purge control solenoid valve can be stuck open, creating a vacuum leak that may not be obvious during a smoke test depending on how the test is performed. This is a known cause that can be diagnosed by checking for vacuum at the valve's intake port at idle or by observing the EVAPCP PID on a scan tool.
OEM Part Supersession History
PY01-13-250→PYFA-13-250A— This is a common supersession for the fuel injector across multiple Mazda models with the 2.5L Skyactiv-G engine. The reason is likely an updated design or manufacturing process to improve reliability.
Heads up: PYFA-13-250A is the specified injector for 2019-2023 Mazda3 2.5L non-turbo models without cylinder deactivation. Using other parts may cause issues.
Model Year Variations Within This Range
- 2021-2023: A 2.5L turbocharged engine option was added in 2021. While it can also experience P0171, it has some unique potential issues, such as oil consumption problems on early 2021/2022 models due to valve stem seals, which could indirectly affect combustion and fuel trims.
- 2019-2020: Some earlier models in this generation (2019-2020) were equipped with cylinder deactivation on the 2.5L engine. This feature was reportedly removed starting in 2021 due to reliability concerns. While not a direct cause of P0171, issues with this system could potentially complicate engine diagnostics.
- 2023: For the 2023 model year, the base 2.0L engine was dropped, and the standard 2.5L non-turbo engine was tuned for a slight increase in horsepower. This change in tuning is unlikely to affect the diagnosis of P0171.
Helpful Videos
We Have This Part in Stock
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.
- Mazda MAZDA3:
- 🧭 Diagnostic Flowchart
- 🎬 Helpful Videos
- 🛍️ Shop This Part
- What's Unique About the 2019-2023 Mazda MAZDA3
- Symptoms You May Notice
- Most Likely Causes
- Rare But Worth Checking
- Diagnosis Steps
- Parts You'll Likely Need
- Related Codes That Often Appear With This One
- Technical Service Bulletins (TSBs) & Recalls
- Platform-Specific Known Issues
- Mechanic-Grade Diagnostic Values
- Real Owner Repair Stories
- "I Checked Everything" — The Actual Cause
- OEM Part Supersession History
- Model Year Variations Within This Range
- 🎟️ Get 5% Off