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

BMW N20 & N26 Oxygen Sensor Guide: 2012-2018 328i, 528i, X3 & More

Diagnose and fix common check engine light codes like P0131 and P0141, poor fuel economy, and rough running caused by failing oxygen sensors in your BMW.

6 minutes to read 2015-2018 BMW X4 2016-2018 BMW X5 2013-2017 BMW X3 2012-2016 BMW 328i 2012-2016 BMW 528i 2012-2016 BMW Z4 2014-2016 BMW 228i 2014-2016 BMW 428i 2013-2015 BMW X1
Difficulty
2/5
Est. Time
1 hrs
DIY Doable?
✅ Yes
Shop Labor
$120 - $250
Used OEM Price
$40 - $80
⚠️ Drivable, but... — Yes, but driving for extended periods can lead to poor fuel economy, failed emissions tests, and potential long-term damage to the expensive catalytic converter.
Key Takeaways
  • These BMWs use two different O2 sensors: an upstream (pre-cat, P/N 11787589121) for fuel control and a downstream (post-cat, P/N 11787589122) for emissions monitoring.
  • Common failure symptoms include a Check Engine Light (codes P0131, P0141), poor fuel economy, and a rough idle.
  • Replacement is a simple DIY job (2/5 difficulty) accessible from the top of the engine, requiring a special 22mm O2 sensor socket.
  • Always use OEM (Bosch) or a quality used OEM sensor; cheap aftermarket sensors are known to cause persistent problems with the BMW engine computer.
Your BMW's N20 or N26 engine uses two oxygen sensors (also called O2 or lambda sensors) to run efficiently and cleanly. The first sensor, called the upstream or pre-catalyst sensor, sits in the exhaust downpipe before the catalytic converter. It constantly measures the air-to-fuel ratio of the exhaust gas and sends this information to the engine computer (DME). The DME uses this data to make instant adjustments to the fuel mixture for optimal power and fuel economy. The second sensor, the downstream or post-catalyst sensor, is located after the catalytic converter. Its job is to monitor the converter's efficiency by comparing its reading to the upstream sensor's reading, ensuring the emissions system is working correctly.

Symptoms of a Failing Oxygen Sensor

A BMW dashboard displaying a check engine light, indicating a potential oxygen sensor failure.
A Check Engine Light (CEL) is the most common symptom of a failing oxygen sensor on the N20 engine, often accompanied by codes like P0171 or P0030.
A side-by-side comparison of a clean, healthy oxygen sensor versus a failed sensor with oil contamination and soot buildup.
When buying used, compare the sensor's condition: a healthy sensor (left) should have clean pins and a clear tip, while a failed sensor (right) may show oil contamination or heavy soot.

A failing oxygen sensor will almost always trigger a Check Engine Light. Depending on which sensor is failing (upstream or downstream), you may also notice other performance issues.

  • Check Engine Light: This is the most common symptom. Specific codes will point to which sensor has a problem and what kind of problem it is (e.g., a bad heater circuit or an out-of-range reading).
  • Poor Fuel Economy: If the upstream sensor fails, the engine computer can't properly adjust the fuel mixture, often causing the engine to run rich (using too much fuel).
  • Rough Idle or Engine Misfires: An incorrect air-fuel mixture can disrupt the engine's smooth operation, leading to a shaky idle, hesitation, or misfires.
  • Rotten Egg Smell: A rich-running condition caused by a bad sensor can overwhelm the catalytic converter, producing a distinct sulfur or rotten egg smell from the exhaust.
  • Failed Emissions Test: Since the oxygen sensors are key emissions components, a faulty one will cause your vehicle to fail an emissions inspection.

Upstream vs. Downstream Sensor: Which One Do You Need?

The exhaust side of a BMW N20 engine showing the locations of the pre-catalyst and post-catalyst oxygen sensors.
The N20 engine features two distinct sensors: the upstream sensor (pre-catalyst) for fuel management and the downstream sensor (post-catalyst) for emissions monitoring.

The 4-cylinder N20 and N26 engines have one upstream and one downstream oxygen sensor. They are different parts with different part numbers and are not interchangeable. The upstream sensor is more critical for engine performance, while the downstream sensor primarily monitors emissions equipment.

Sensor Position Common Part Numbers Primary Function Common Fault Codes
Upstream (Pre-Catalyst) BMW: 11787589121, Bosch: 17272 Measures air/fuel ratio for engine management P0131, P0030, P0171
Downstream (Post-Catalyst) BMW: 11787589122, Bosch: 16239 Monitors catalytic converter efficiency P0136, P0140, P0141, 12B701

Vehicle Fitment Guide

This guide covers the oxygen sensors for the 2.0L N20 and N26 engines found in the following North American market vehicles:

  • 2014-2016 BMW 228i (F22, F23)
  • 2012-2016 BMW 328i (F30, F31, F34)
  • 2014-2016 BMW 428i (F32, F33, F36)
  • 2012-2016 BMW 528i (F10)
  • 2013-2015 BMW X1 28i (E84)
  • 2013-2017 BMW X3 28i (F25)
  • 2015-2018 BMW X4 28i (F26)
  • 2016-2018 BMW X5 40e (F15)
  • 2012-2016 BMW Z4 28i (E89)

Buying a Used Oxygen Sensor

While sensors are often replaced new, a low-mileage used OEM sensor can be a reliable and cost-effective alternative to a new, unbranded aftermarket part. For sensitive electronics like oxygen sensors, it is highly recommended to use the original equipment manufacturer (OEM) part, which is Bosch for these BMWs. Cheap aftermarket sensors are known to cause persistent check engine lights and communication issues with the BMW DME. When buying a used sensor, here’s what to inspect:

  • Verify the Part Number: Double-check that the number stamped on the sensor or its connector matches the one you are replacing. Upstream (...121) and downstream (...122) sensors look similar but are not interchangeable.
  • Inspect the Wiring and Connector: The entire length of the wire should be free of cuts, melting, or fraying. The plastic connector should be intact with no broken clips, and the pins inside should be clean and free of corrosion.
  • Check for Oil Contamination: The N20 engine is known for valve cover gasket leaks, which can drip oil directly onto the oxygen sensor wiring and connector, causing failure. Avoid any sensor that is soaked in old oil.
  • Examine the Sensor Tip: The protective metal cage at the tip should be intact. A heavy coating of white or black soot can indicate it came from a poorly running engine.
  • Consider the Mileage: Oxygen sensors are wear items. A sensor from a vehicle with under 60,000 miles is a good bet. Sensors can last over 100,000 miles, but their performance degrades over time.

Known Issues & Recalls

A BMW X3, one of the models affected by the voluntary emissions recall regarding oxygen sensor diagnostic software.
Certain 2011-2013 BMW X3 models were subject to a voluntary recall (13E-A03) to correct a software error that prevented proper oxygen sensor diagnosis.

Voluntary Recall 13E-A03: BMW issued a voluntary emissions recall for some 2011-2013 BMW X3 models with the N20 engine. The issue involves a software error in the DME that could prevent proper diagnosis of the oxygen sensors. The fix is a simple software update performed by a BMW dealer.

A very common issue that leads to premature oxygen sensor failure on the N20 engine is an oil leak from the valve cover gasket. The gasket is located directly above the exhaust manifold, and when it leaks, oil can drip onto the hot exhaust and onto the oxygen sensor connectors, damaging the wiring and causing faults like P0131.

Replacement Overview & Difficulty

  • Difficulty Rating: 2 out of 5
  • Estimated Time: 1 hour
  • Tools Needed: Ratchet, extensions, 22mm (or 7/8-inch) offset oxygen sensor socket.

Replacing both the upstream and downstream oxygen sensors on the N20/N26 engine is a DIY-friendly job. Both sensors are located on the passenger side of the engine and are accessible from the top of the engine bay after removing the plastic engine cover.

🎬 Watch this step-by-step N20/N26 oxygen sensor replacement video.

The upstream sensor is visible right on top of the downpipe, 🎬 See how to replace the upstream oxygen sensor. just after the turbocharger. The downstream sensor is located further down the exhaust pipe, after the catalytic converter. The electrical connectors are clipped to a bracket near the top of the engine. The main challenge is often breaking the old sensor loose from the exhaust pipe, which may require some penetrating oil and a breaker bar.

Pro Tip: New oxygen sensors from Bosch come with anti-seize compound pre-applied to the threads. If you are installing a used sensor, apply a small amount of high-temperature anti-seize to the threads before installation, being careful not to get any on the sensor tip itself. This will make future removal much easier.

Cost Comparison

Part SourceEstimated Price Range (Per Sensor)
New Genuine BMW$250 - $300
New OEM (Bosch)$70 - $150
Used OEM$40 - $80
Shop Labor$120 - $250

Frequently Asked Questions (FAQ)

Can I replace just one oxygen sensor?

Yes. You only need to replace the sensor that has failed and is causing the fault code. The upstream and downstream sensors wear at different rates and do not need to be replaced in pairs.

Is there a difference between the sensors for the N20 and N26 engine?

No, the oxygen sensors themselves are the same for both the N20 and the N26 (SULEV) version of the engine. The primary difference between the engines is in the catalytic converter and other emissions components, but the sensors interchange.

Do I need to reset the computer after replacing the sensor?

After replacing the sensor, you should use a standard OBD-II scanner to clear the fault codes from the engine computer (DME). The computer will then re-learn the fuel trims with the new, functioning sensor. If you don't clear the codes, the Check Engine Light may stay on for several drive cycles before turning off on its own.

Can a bad valve cover gasket really cause an oxygen sensor code?

Yes, absolutely. On the N20 engine, a leaking valve cover gasket can drip oil onto the oxygen sensor's wiring harness. This can contaminate the connector or damage the wire's insulation, leading to short circuits or open circuits that trigger fault codes like P0131 (low voltage) or heater circuit faults. If you have an O2 sensor code, always inspect the area for oil leaks.

🎬 Watch this DIY guide to replace a leaking valve cover gasket.
2016 BMW 428I XDRIVE N20/N26 OXYGEN SENSORS (O2 SENSORS) CHANGE
2016 BMW 428I XDRIVE N20/N26 OXYGEN SENSORS (O2 SENSORS) CHANGE
BMW F30 upstream oxygen sensor N20
BMW F30 upstream oxygen sensor N20
BMW P0171 & Rough Idle FIXED! Torn PCV Diaphragm on N20 Engine
BMW P0171 & Rough Idle FIXED! Torn PCV Diaphragm on N20 Engine
2013 BMW 328i 4 cyl Turbo F30/N20 Engine - Valve Cover Gasket
2013 BMW 328i 4 cyl Turbo F30/N20 Engine - Valve Cover Gasket
BMW N20 Valve Cover Gasket Replacement: Step-by-Step DIY (F30, F32, E84)
BMW N20 Valve Cover Gasket Replacement: Step-by-Step DIY (F30, F32, E84)

Technical Specifications

OEM Part Numbers: 11787589122 7589122 11787589121

Upstream Sensor (Air/Fuel Ratio), Downstream Sensor (Catalyst Monitoring). Both are heated 4-wire sensors. Requires a 22mm (7/8") oxygen sensor socket for removal/installation.

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 Oxygen Sensor for:
  • BMW 328i: 2012201320142015201620172018
  • BMW 528i: 20122013201420152016
  • BMW X3: 20132014201520162017
  • BMW Z4: 20122013201420152016
  • BMW X4: 2015201620172018
  • BMW 228i: 201420152016
  • BMW 428i: 201420152016
  • BMW X1: 201320142015
  • BMW X5: 201620172018
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