Skip to content
Skanyx
Guides/12 min read

How to Fix P0171 (System Too Lean): Causes and Repair Cost

Skanyx TeamUpdated:

P0171 is usually a cheap fix: a split air hose or a dirty airflow sensor. Most repairs land under €200. Safe to drive for a week or two, unless it flashes.

In this article(10)
  1. 01Is it safe to drive with P0171?
  2. 02What does it cost to fix?
  3. 03What should you do right now?
  4. 04What causes P0171?
  5. 05Can you fix it yourself, or is this a workshop job?
  6. 06How do you diagnose P0171?
  7. 07Will P0171 clear itself?
  8. 08What happens if you ignore P0171?
  9. 09What is the difference between P0171 and P0174?
  10. 10Frequently asked questions

The engine light came on halfway through the school run. The car pulls away fine, nothing rattles, and the only odd thing is that it has idled a bit rough at the lights all week. A borrowed reader gives you one line: P0171, system too lean.

That line does not name a broken part. It says the engine is getting more air than the fuel it was given. The gap between the cheap version of that problem and the expensive one is roughly €3 to €800, which is why the next step is finding out which one you have.

Is it safe to drive with P0171?

Yes, with care, for a week or two. A mildly lean engine will not strand you at the roadside, and the car usually drives close to normal.

Four things change that answer. The light starts flashing. The car shakes or stumbles as you pull away. You lose power on a hill. Or there is a hot, sharp smell from under the car.

A flashing light is the serious one. It means fuel is passing into the exhaust unburned, and that can wreck the catalytic converter (the emissions box under the floor) on a single motorway run. Park up and get the code read the same day.

The slow version of the risk is the same part. Weeks of running thin overheats the converter from the other direction, and replacing one costs more than every cause below put together. That is the whole reason not to leave this for a month.

What does it cost to fix?

Below is what each cause usually costs at an independent garage, with the do-it-yourself price where there is one. These are rough forecasts rather than quotes: the same job on a premium German car sits at the top of every row.

Likely causeWhat it usually costsHow long you can wait
A split or unclipped air pipe€3 to €15 for the pipe, €50 to €200 fittedA week or two
A dirty airflow sensor (MAF)€10 to €20 to clean it yourselfA week or two
An airflow sensor that needs replacing€160 to €400 fittedA week or two
A leaking intake or breather gasket€150 to €500A week or two
A blocked fuel filter€30 to €80Days, if the car hesitates uphill
A tired fuel pump€300 to €800Days, if the car hesitates uphill
An exhaust leak in front of the first sensor€80 to €300A week or two
A worn exhaust sensor (lambda)€130 to €400A week or two
Converter damage from months of running thin€500 to €3,000The reason to fix the cause early
Two things move the number. One is the make: parts and labour on a premium German car run high. The other is whether the garage rules out the cheap causes before it starts ordering sensors. Ask for the diagnosis to be itemised before any part goes on the bill.

What should you do right now?

  1. Open the bonnet with the engine idling and look along the thick rubber pipes between the air filter box and the engine. You are looking for a split, a loose clip, or a pipe that has popped off its stub. This costs nothing and it finds the cheapest cause more often than anything else you can do in five minutes.
  2. Read the stored code yourself. Any 15 to 30 euro ELM327 Bluetooth adapter plugs into the socket under the dash and an app on your phone reads it in about a minute; the code turns "a light is on" into a named fault with a severity, and it shows you whether P0171 is on its own or has company.
  3. Decide with the code in hand. P0171 alone points at air getting in where it should not. P0171 next to P0174 means both sides of the engine are affected, so the cause is something they share. P0171 next to a misfire code such as P0301 or P0300 means the mixture has gone thin enough to skip combustion, and that moves the job up the queue.
  4. Book the garage if the free look found nothing, or if the car hesitates under load. Hand over the code and the symptom and let them diagnose it. A fair diagnostic charge at an independent shop is €30 to €80, and many waive it if they do the repair.

What causes P0171?

The causes below run cheapest and most common first, which is also the order to check them in.

Air getting in after the measuring point (a vacuum leak)

The engine measures the air coming in, then adds fuel to match. Any air that sneaks in after that measuring point arrives without fuel to go with it, so the mixture ends up thin. A garage will call this a vacuum leak. The engine keeps adding fuel to make up the difference, and when it runs out of room to correct, it lights the dash.

The tell is when it happens. This kind of leak is worst at idle and gets better as you drive, because at idle the engine pulls hardest through every gap. A car that idles rough at the lights but feels normal at 80 km/h fits this pattern.

Where to look, in order: the thick pipes between the air box and the engine, then the gasket where the intake bolts on. After that, the hose to the brake servo and the small breather valve (the PCV) on top of the engine. Rubber goes hard and splits. Plastic elbows snap. Gaskets dry out. A €3 pipe puts a lot of these right.

A breather valve stuck open behaves like a large hole. On VW group and BMW engines it is often built into the cam cover, which is why the repair there is a few hundred euros rather than a few. Carbon around the throttle can push the reading the same way, so it is worth cleaning the throttle while the intake is open.

A dirty airflow sensor

The airflow sensor (the MAF) sits in the pipe just after the air filter and counts the air going past a heated wire. Oil mist and dust settle on that wire and it starts under-reading. The engine then fuels for less air than is really arriving, and the mixture goes thin.

The tell here is the opposite of a leak. The car runs thin everywhere rather than just at idle, and you may notice flat throttle response and worse fuel economy with it.

Cleaning is the first move and it works more often than people expect. A can of the proper sensor cleaner is €8 to €15. Take the sensor out, spray the wire, let it dry fully, refit it. Never use brake cleaner or contact cleaner, because the residue they leave makes things worse. The MAF sensor cleaning guide has the step-by-step.

Not enough fuel arriving

If fuel pressure is low, the engine runs thin no matter how well it measures the air. A tired pump does it, so does a blocked filter or a failing pressure regulator.

This cause has its own signature: it is worst under load. Pulling up a hill, overtaking or towing is when the car runs short of fuel supply and hesitates, while idle and gentle cruising feel fine. If the fuel filter has not been changed in 80,000 km and the car has a serviceable one, start there for €30 to €80.

An exhaust leak in front of the first sensor

This is the sneaky one. A crack or a leaking joint between the engine and the first exhaust sensor lets fresh air get pulled into the pipe between pulses. The sensor sees that extra oxygen and reports a thin mixture that is not really there. The engine then adds fuel to correct a problem that does not exist.

Listen for a tick or a hiss from the front of the exhaust that speeds up with the engine and is loudest before it warms through. Repairs run €100 to €400 depending on where the leak sits.

A lean code is where guessing gets expensive: a split €3 pipe and an €800 fuel pump set exactly the same P0171, and the dashboard shows you no difference between them. Skanyx reads the code and the live fuel trims behind it: long-term trim high at idle and settling toward zero at 2,500 rpm points at a vacuum leak, while trim high at every speed points at fuel delivery or the MAF. That is the check that tells you whether to buy a pipe or book the pump, and it says whether the car is fine to drive in the meantime. Check your fuel trims tonight

A worn exhaust sensor

Less common, but it happens. A sensor that has gone lazy, or one that reads permanently thin, pushes the engine to keep adding fuel until the code sets.

It usually brings company. If P0135 or P0131 is stored alongside P0171, the sensor itself is the likely root. If P0171 is on its own, work through the causes above first. The oxygen sensor testing guide covers how to confirm it before you spend.

A bad tank of fuel

Worth a thought if the light appeared within a day of filling up. Water or poor-quality petrol can thin the mixture out for a tankful. Run the tank down, then fill up somewhere else and watch whether the code comes back. This one costs nothing to test.

Can you fix it yourself, or is this a workshop job?

You can do this at home if the cause is one of the cheap ones. Finding and replacing a split air pipe needs a screwdriver, a torch and about half an hour. Cleaning the airflow sensor needs a can of cleaner and about the same. A fuel filter on a car with a serviceable one is a first or second job for a beginner. Between them, those three cover the majority of the codes that get fixed cheaply.

Book a workshop when the free checks come up empty, when the car hesitates under load, when the noise points at the exhaust, or when the sensor you would need to reach sits somewhere you cannot safely get at. Fuel systems hold pressure even with the engine off, and that is a good reason to leave them alone without the right tools.

A fair visit looks like this. The garage charges €30 to €80 for the diagnosis at an independent shop, or €80 to €150 at a dealer. The quote itemises parts and labour separately. Nobody orders a sensor before the cheap causes are ruled out. If a shop quotes an airflow sensor and a lambda sensor together on a first visit without showing you why, that is worth a second opinion. The car diagnostic cost guide covers what a proper diagnosis includes.

How do you diagnose P0171?

The order matters, because it stops you paying for parts that were never the problem.

Step 1: look and listen. Engine idling, bonnet up. Check every rubber pipe on the intake side for splits and loose clips. Listen for a hiss. A short spray of carburettor cleaner near a suspected gap will change the idle speed if that is where the air is coming in, so keep it well away from anything hot and use very little. Step 2: read the live numbers. Plug in an adapter and open the live data. The number to watch is fuel trim, which is how much extra fuel the engine is adding to cope. Above +10% confirms the engine is running thin. Note whether it is worse at idle than at 2,500 rpm: worse at idle points at a leak, the same at both points at the airflow sensor or fuel supply. The live data guide explains what the numbers mean. Step 3: read the snapshot. The car saved the exact conditions from the moment the fault set. A fault that set at idle and low load points one way, a fault that set under load points the other. Step 4: clean the airflow sensor. Cheap and quick. It clears a fair share of these on its own. Clear the code afterwards and drive. Step 5: check fuel pressure. Only once the first four come up empty. Compare against the figure in the workshop data for your car, at idle and under load. Step 6: check the exhaust and the sensor. Look for leaks at the manifold and the joint below it. If the exhaust is sound and the sensor codes are stored, the sensor is next.

After any repair, clear the code and drive for 15 to 20 minutes of mixed roads so the engine can relearn. If the code stays away and the fuel trim settles back under 10%, the job held.

Will P0171 clear itself?

The light can switch itself off, and it does not mean what people hope it means.

Most engines will turn the light off after roughly 40 warm-up cycles with no repeat of the fault. If you fixed the cause, or if the trigger was one bad tank of fuel, that is a genuine all-clear. If nothing was fixed, the light goes out, the fault carries on underneath it, then the light comes back. The stored history stays in the memory either way, so a garage or a used-car buyer can still see it.

Clearing the code by hand does the same thing faster and with the same catch. It is useful to confirm a repair worked. It is useless as a fix, and it wipes the snapshot data that would have told you where to look.

What happens if you ignore P0171?

Two things, one slow and one fast.

The slow one is the converter. A thin mixture burns hotter than the engine was designed for, and months of that cooks the catalyst until it fails on its own. That turns a €50 job into a €500 to €3,000 one, and it will usually announce itself with a P0420 code.

The fast one is that the light is now busy. With P0171 lit, you have no way of knowing when something more serious sets a second code, because the dash already looks the same either way. You are driving without the warning system you paid for.

There is a third cost that is easy to forget: an illuminated engine light fails the roadworthiness test in most of Europe, so this becomes urgent the month your test is due.

What is the difference between P0171 and P0174?

They are the same fault on different halves of the engine. P0171 covers the side with cylinder 1, P0174 covers the other side. Four-cylinder engines only have one side, so they only ever set P0171.

Seeing both together is useful information rather than double the trouble. It means the cause is something both halves share: a large air leak, the airflow sensor, or fuel supply. It rules out anything that could only affect one side. The P0174 guide covers that case in detail, and the mirror-image code, P0172, is what you get when the mixture is too heavy on fuel instead.

Frequently asked questions

How long can I keep driving with P0171?

A week or two of normal use is reasonable while you sort out the repair, as long as the light is steady and the car drives normally. Cut that short if the light flashes or the car starts shaking.

Does P0171 mean I need a new airflow sensor?

Not on its own. The code describes the result, not the part. Cleaning the sensor, or finding a split pipe, resolves a large share of these for under €20.

Why did P0171 come back after I cleared it?

Because clearing removes the record, not the fault. The engine re-runs the same self-test as you drive and logs the code again as soon as it sees the same thing.

The next step is the small one: bonnet up, engine idling, and a slow look along the air pipes for a split or a clip that has let go. If that comes up clean, read the code and its live numbers before you spend anything, because the difference between a €3 pipe and an €800 pump is visible in the data long before it is visible on the bill.

Codes named in this guide: P0171, P0174, P0172, P0300, P0301, P0420, P0131, P0135.

Frequently Asked Questions

Is it safe to drive with a P0171 code?
Yes, with care, for a week or two. A mildly lean engine will not strand you and the car usually drives close to normal. Stop sooner if the light starts flashing, the car shakes when you pull away, or you lose power on a hill, because that points at damage happening now rather than later.
How much does it cost to fix P0171?
Most repairs come in under €200. A split air pipe is €3 to €15 as a part and €50 to €200 fitted, and cleaning the airflow sensor costs €10 to €20 in cleaner. The bill only climbs if the cause turns out to be fuel supply, where a pump runs €300 to €800 fitted.
Will a P0171 code clear itself?
The light can switch itself off after roughly 40 clean warm-up cycles, but only if the fault genuinely stopped happening. That is normal after a real repair, or after a bad tank of fuel has been used up. If nothing was fixed, the light goes out and comes back, and the stored history is still there when a garage looks.
Can I fix P0171 myself?
Often, yes. Finding and replacing a split air pipe and cleaning the airflow sensor are both beginner jobs with basic hand tools and about an hour. Fuel pressure testing, exhaust repairs and sensor replacement in awkward positions are the point to hand it over to a garage.
Can P0171 cause a misfire?
Yes, once the mixture gets thin enough. A lean mixture burns slower, and if it goes far enough the cylinder skips combustion entirely. Expect P0300 or a cylinder-specific code such as P0301 to appear alongside P0171 when it gets bad. Those misfire codes are the result, not a second fault, and they usually stop once the lean cause is fixed.
Quick reference

This article covers these diagnostic codes. Tap any code for a detailed breakdown with causes, costs, and vehicle-specific fixes:

Author

Skanyx Team

Skanyx engineering team

Skanyx is written by the engineers who build the app and keep two BMWs of their own on the road, an E60 535d and a pre-facelift E61 535. Content is drafted with AI assistance and edited by the team. Repair-cost ranges are compiled from published parts prices, workshop price lists and repair-cost guides and rounded, fault codes follow the SAE definitions, and where a figure comes from a specific study or vendor page, the post lists it under Sources.

How we write and use AI