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 →
🎬 Helpful Videos 🛍️ Shop This Part

P0171 on 2021-2023 Mazda MX-5: Causes and Fixes for a Lean Fuel System

On a 2021-2023 Mazda MX-5, a P0171 code is most often caused by a dirty Mass Airflow (MAF) sensor, a vacuum leak (especially from hardened intake manifold gaskets), or faulty fuel injectors as identified in a Mazda Technical Service Bulletin. Start by cleaning the MAF sensor and checking for intake leaks before moving to more complex diagnostics.

15 minutes to read 2021-2023 Mazda MX-5
Most Likely Cause
Vacuum Leak
Est. Time
1.8 hrs
Shop Labor
$100 – $1200
Parts Price
$10 – $800
⚠️ Drivable, but... — Yes, but it's not recommended for extended periods. A lean condition can cause poor performance, hesitation, and potentially lead to engine misfires, stalling at stops, and long-term damage to the catalytic converter due to higher combustion temperatures.
Key Takeaways
  • P0171 means your MX-5's engine is running with too much air or not enough fuel.
  • Always start with the simplest fixes: check for cracked air intake hoses and clean the Mass Airflow (MAF) sensor with a dedicated cleaner.
  • A Mazda Service Bulletin (MT-004-22) specifically points to faulty fuel injectors as a potential cause on this engine if the simple fixes don't work.
  • Ignoring this code can lead to poor fuel economy, rough running, and eventual damage to more expensive components like the catalytic converter.
The trouble code P0171 stands for "System Too Lean (Bank 1)". This means the engine's computer, or Powertrain Control Module (PCM), has detected that there is too much air and not enough fuel in the air-fuel mixture. The PCM tries to compensate by adding more fuel (a process called 'positive fuel trim'), but it has reached its maximum adjustment limit, often when total fuel trim exceeds +25% or the long-term fuel trim exceeds +15%, without correcting the lean condition, triggering the Check Engine Light. Since the MX-5's inline four-cylinder engine has only one bank of cylinders, this code applies to the entire engine.

What's Unique About the 2021-2023 Mazda MX-5

While most vehicles with a P0171 code suffer from common issues like vacuum leaks or dirty MAF sensors, Mazda has issued a specific Technical Service Bulletin (TSB MT-004-22) for its Skyactiv engines, including the one in the 2021-2023 MX-5. This bulletin provides a clear diagnostic path that, after checking for intake leaks and sensor faults, points directly to replacing the fuel injectors 🎬 Watch: Diagnosing P0171 on a Mazda SkyActiv engine as the definitive repair. This makes injector issues a more probable and officially recognized cause on this platform compared to many other vehicles once simpler causes are ruled out.

Diagnostic Flowchart

Tap your situation to follow the diagnostic path that matches what you're seeing on this vehicle.

When inspecting the engine bay at idle, what do you notice first?
→ Correctly seat the air filter box lid and tighten all intake tube clamps. This is the first step in Mazda TSB MT-004-22 and costs $0.
→ You likely have a vacuum leak. Inspect hoses and the four intake manifold gaskets (OEM PE01-13-111, $30-$50). A smoke test can pinpoint the exact leak.
Do you have an OBD-II scanner to view live engine data?
→ Check MAF readings (should be 2.0-3.5 g/s at idle). If low, clean it ($10-$15). Also check fuel trims; if LTFT > 15%, check A/F sensor voltage.
→ Clean the MAF sensor with dedicated cleaner ($10-$15). If the code returns, Mazda TSB MT-004-22 points to replacing the fuel injectors ($400-$800 for OEM set).

Symptoms You May Notice

  • Check Engine Light is on
  • Rough or unstable idle, sometimes fluctuating or 'hunting'
  • Hesitation or lack of power during acceleration
  • Reduced fuel economy
  • Engine misfires, which may trigger additional codes like P0300-P0304
  • Audible hissing sound from the engine bay, indicating a vacuum leak
  • Hard starting, requiring long crank times
⚠️ Don't Waste Money on the Wrong Fix
  • Replacing the downstream (post-catalyst) oxygen sensor. The downstream sensor's primary role is to monitor catalyst efficiency, while the upstream (pre-catalyst) sensor is responsible for fuel trim adjustments.
  • Replacing the fuel pump without first confirming low fuel pressure with a gauge.
  • Replacing the A/F sensor without first ruling out much more common vacuum leaks and MAF sensor issues.

Most Likely Causes

  1. Vacuum Leak 🔴 High Probability Rubber and plastic components in the engine bay degrade over time. On Skyactiv-G engines, the intake manifold gaskets are a very common failure point, becoming hard and brittle. Other sources include cracked hoses (PCV, brake booster) or a loose air intake tube.
    How to confirm: Visually inspect all vacuum lines and the air intake hose for cracks or loose connections. Listen for a hissing sound at idle. A smoke test is the most effective way 🎬 See how to troubleshoot a lean bank 1 code to pinpoint the source of a leak. Pay close attention to the intake manifold gasket area and the brake booster line.
    Typical fix: Replace the cracked hose or failed gaskets. The intake manifold gaskets (four required) are a frequent fix.
    Est. part cost: $5 for a hose, $30-$50 for a set of four intake manifold gaskets (OEM Part No. PE01-13-111).
  2. Dirty or Faulty Mass Airflow (MAF) Sensor 🔴 High Probability The MAF sensor is located in the intake tract and can become contaminated with dirt or oil, causing it to inaccurately measure the air entering the engine and leading the PCM to calculate an incorrect fuel mixture. Over-oiling a reusable air filter (like a K&N) is a known cause for MAF sensor contamination.
    How to confirm: Inspect the sensor for contamination. Monitor MAF readings with an OBD-II scanner; they should be around 2.0-3.5 g/s at idle for a warm engine and increase smoothly with RPM. A common first step is to clean the sensor with a dedicated MAF sensor cleaner.
    Typical fix: Clean the sensor using a specialized MAF sensor cleaner. If cleaning does not resolve the issue, the sensor may need to be replaced.
    Est. part cost: $10-$15 for cleaner, $150-$250 for a new sensor.
  3. Improperly Seated Air Filter / Intake Components 🟡 Medium Probability If the air filter housing is not sealed correctly after service, unmetered air can be drawn into the engine past the MAF sensor, causing a lean condition. This is the first inspection step listed in Mazda's TSB.
    How to confirm: Visually inspect the air filter box to ensure it is fully closed and all clips or bolts are secure. Check that the intake tube is properly clamped at both the airbox and the throttle body.
    Typical fix: Correctly seat the air filter box lid and tighten all clamps and bolts.
    Est. part cost: $0
  4. Faulty Fuel Injectors 🟡 Medium Probability Mazda TSB MT-004-22 specifically identifies replacing the fuel injectors as the final repair for the P0171 code on 2016-2023 MX-5 models after other inspections fail. The injectors may become clogged or fail electronically, delivering less fuel than commanded.
    How to confirm: This is an advanced diagnostic step. If vacuum leaks, MAF sensor issues, and A/F sensor function have been ruled out per the TSB, injector replacement is the recommended step. A professional may perform a fuel injector balance test or check resistance across the injector coils.
    Typical fix: Replace the set of four fuel injectors.
    Est. part cost: $400-$800 for a set of four OEM injectors.
  5. Faulty Air/Fuel Ratio Sensor (Upstream O2 Sensor) ⚪ Low Probability The A/F sensor is the primary sensor that detects a lean condition. Over time, it can become slow to respond or biased, sending incorrect lean signals to the PCM. However, this should be tested before replacement.
    How to confirm: Use an OBD-II scanner to graph the sensor's voltage. A healthy sensor should show rapidly fluctuating voltage between approximately 0.1 and 0.8 volts. A slow or flat-lining sensor is likely faulty. The TSB lists this as an inspection point before replacing injectors.
    Typical fix: Replace the upstream Air/Fuel Ratio sensor (Bank 1, Sensor 1).
    Est. part cost: $100-$200

Rare But Worth Checking

  • Low Fuel Pressure: Could be caused by a weak fuel pump or a clogged fuel filter/strainer. Check fuel pressure at the fuel rail with a gauge to confirm. The Skyactiv-G direct injection system has a high-pressure side that should be approximately 435 psi at idle. It's less common on newer vehicles but still a possibility.
  • Exhaust Leak: A crack or leak in the exhaust manifold or pipe before the upstream A/F sensor can pull in outside air, tricking the sensor into reading a false lean condition.

Diagnosis Steps

  1. Read Freeze Frame Data: Use an OBD-II scanner to note the conditions (engine speed, load, temperature) under which the P0171 code was set.
  2. Inspect Intake System Integrity: Per TSB MT-004-22, ensure the engine air filter and airbox are installed correctly and sealed properly. Check that the intake tube is secure.
  3. Inspect for Vacuum Leaks: With the engine running, listen for audible hissing noises around the intake manifold, brake booster, and PCV hoses. A smoke test is the most reliable method to find hard-to-see leaks. Pay special attention to the intake manifold gaskets.
  4. Analyze Fuel Trims: With a scanner, monitor Short-Term (STFT) and Long-Term (LTFT) fuel trims at idle. High positive numbers (e.g., LTFT > 15%) confirm the engine is running lean. Rev the engine to 2500 RPM and hold; if the STFT drops significantly towards 0, a vacuum leak is the most likely cause.
  5. Clean the Mass Airflow (MAF) Sensor: Disconnect and remove the MAF sensor. Spray the delicate sensing elements with a dedicated MAF sensor cleaner. Do not touch the elements. 🎬 Watch: ND Miata MAF sensor cleaning and replacement guide Allow it to dry completely before reinstalling.
  6. Test the Air/Fuel Ratio Sensor: Graph the upstream A/F sensor's voltage with a scanner to ensure it is active and fluctuating rapidly. A lazy or biased sensor may be faulty, but confirm other causes are ruled out first.
  7. Consider Fuel Injectors: If all the above steps do not reveal a cause and fuel trims remain high, follow the guidance of TSB MT-004-22 and consider replacing the fuel injectors.

Parts You'll Likely Need

  • Mass Airflow (MAF) Sensor Cleaner — Often, the MAF sensor is just dirty. Cleaning it is a cheap and easy first step that frequently solves the problem.
    Trusted brands: CRC, Liqui Moly
    Aftermarket price range: $10-$15
  • Intake Manifold Gasket (OEM #PE01-13-111) — These rubber gaskets are a very common source of vacuum leaks on the Skyactiv-G engine as they harden and crack over time. Four are required.
    Trusted brands: Mazda OE
    OEM price range: $8-$15 each
    Aftermarket price range: $5-$10 each
  • Fuel Injector (OEM #PE01-13-250D) — Mazda TSB MT-004-22 points to faulty fuel injectors as a likely cause on this engine after basic checks are performed. They are typically replaced as a set.
    Trusted brands: Mazda OE
    OEM price range: $100-$200 each
    Aftermarket price range: $50-$120 each
  • Mass Airflow (MAF) Sensor (OEM #PE01-13-215 or PYFS-13-215) — If cleaning the sensor does not work, it may be faulty and require replacement.

Related Codes That Often Appear With This One

  • P0300, P0301, P0302, P0303, P0304 — A lean condition can lead to incomplete combustion, causing engine misfires. The TSB MT-004-22 specifically notes that misfire codes (P030X) may appear alongside P0171.
  • P0174 — This code is for 'System Too Lean (Bank 2)'. It will not appear on the MX-5 as its inline-four engine only has one bank.

Technical Service Bulletins (TSBs) & Recalls

  • MT-004-22 (supersedes MT-021/17): Titled 'CHECK ENGINE LIGHT ON WITH DTC P0171'. Applies to most Skyactiv models from 2012-2023. It outlines a specific diagnostic procedure: 1) Inspect airbox/filter for proper fitment. 2) Inspect MAF sensor operation. 3) Inspect A/F sensor operation. 4) If fuel trims remain abnormal, the final step is to replace the fuel injectors. It also notes that P030X misfire codes may accompany P0171.

Platform-Specific Known Issues

  • Mazda Technical Service Bulletin (TSB) #MT-004-22 addresses P0171 on 2016-2023 MX-5 models. It outlines a procedure to first inspect for intake leaks, a faulty MAF sensor, and a faulty A/F sensor. If the problem persists, the TSB directs technicians to replace the fuel injectors. [⭐]

Mechanic-Grade Diagnostic Values

  • Mass Airflow (MAF) Sensor Voltage — expected: Approx. 0.72 V at Key On, Engine Off. Approx. 1.15 V at warm idle.. Failure: Voltage significantly different from expected values, or not increasing smoothly with RPM.
  • Mass Airflow (MAF) Sensor Flow Rate — expected: Approx. 4.29 g/s at warm idle. Approx. 12.71 g/s at 4,000 RPM.. Failure: Readings that are stuck, erratic, or significantly deviate from expected values under specific RPM conditions.
  • High-Pressure Fuel System Pressure — expected: Approx. 3 MPa {31 kgf/cm², 435 psi} at idle.. Failure: Pressure significantly lower than 435 psi at idle, indicating a potential issue with the high-pressure fuel pump or sensor.
  • Long Term Fuel Trim (LTFT) — expected: Close to 0%.. Failure: Sustained value of +15% or more, indicating the PCM is consistently adding large amounts of fuel to compensate for a lean condition.
  • Total Fuel Trim (STFT + LTFT) — expected: Close to 0%.. Failure: Combined value exceeds +30%, which is a common threshold for triggering P0171.

Scan Tool Commands That Help

  • Mazda M-MDS or equivalent (e.g., FORScan): Access FUEL_PRES PID — To verify the high-pressure side of the direct injection fuel system is meeting its target pressure of approximately 435 psi at idle.
  • Mazda M-MDS or equivalent (e.g., FORScan): Clear Fuel Trim Data / Reset KAM — After a repair (like fixing a vacuum leak or replacing a sensor), this command resets the learned long-term fuel trim values to zero, allowing for a faster assessment of whether the fix was successful.

Wiring & Ground Locations

  • Left Front Strut Tower Ground — In the engine bay, on the driver's side strut tower.. A poor engine-to-chassis ground can cause erratic behavior from various engine sensors, including those that influence fuel calculations. This is a primary grounding point that should be clean and tight.
  • MAF Sensor Connector — On the MAF sensor, part of the air intake tube after the air filter box.. This connector provides power, ground, and signal lines for the MAF sensor. A corroded or loose pin can cause incorrect MAF readings, leading to P0171. Pin C is the signal wire to PCM terminal 2BC, and Pin B is the ground wire to PCM terminal 2AY.
  • Main Engine Harness Ground — Typically found on the top or front of the transmission housing.. This is a critical ground for the main engine wiring harness, which includes circuits for injectors and sensors. A loose or corroded connection here can cause widespread electrical issues.

Real Owner Repair Stories

  • Reddit user enblightened on r/Miata (2016 Mazda MX-5) — Check Engine Light with code P0171 after driving for about 60 miles.
    ❌ Tried (didn't work) Clearing the code initially (it did not return immediately but the underlying cause was still present).
    ✅ What actually fixed it The user had just cleaned and re-oiled a K&N air filter the night before. The issue was determined to be over-oiling the filter, which contaminated the MAF sensor. The final fix was cleaning the MAF sensor.

OEM Part Supersession History

  • PEAR-13-250, PE01-13-250B, PE01-13-250CPE01-13-250D — Standard revision and improvement by the manufacturer.

Model Year Variations Within This Range

  • 2021-2023: No significant variations in the engine management system, fuel system, or common causes for P0171 have been documented for the 2021-2023 model years. A minor update in late 2021 for 2022+ models introduced Kinematic Posture Control (KPC) which affects suspension/chassis dynamics but does not alter the engine or its diagnostics for this code.
MX-5 Mass Air Flow Sensor Cleaning
MX-5 Mass Air Flow Sensor Cleaning
P0171 SYSTEM TOO LEAN BANK 1 Mazda 3 Troubleshooting
P0171 SYSTEM TOO LEAN BANK 1 Mazda 3 Troubleshooting
Mass Airflow Sensor (MAF) Cleaning or Replacement | ND Mazda Miata (2016-2025)
Mass Airflow Sensor (MAF) Cleaning or Replacement | ND Mazda Miata (2016-2025)
p0171 / Mazda SkyActiv
p0171 / Mazda SkyActiv
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 Jul 21, 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 for:
  • Mazda MX-5: 202120222023
In this article
🎬 Helpful Videos
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