Fuel Trim Diagnostics: Reading STFT and LTFT to Fix P0171, P0174 and Rich Codes

A P0171 on one car, a rough idle with no codes on another, a bike that pops on the overrun after a new exhaust: the quickest route to the cause is often the same pair of numbers. Short-term fuel trim (STFT) and long-term fuel trim (LTFT) show how much the ECU is correcting the mixture away from its base calculation. This guide focuses on reading those values as a diagnostic tool on petrol engines in cars, gas-fuelled vans and trucks, utility machines and motorcycles.

Diagram of closed-loop fuelling: air-mass input, base fuel calculation, long-term and short-term fuel trim corrections, injectors, combustion and upstream lambda sensor feeding the STFT controller and LTFT adaptation
Closed-loop fuelling: how STFT and LTFT are built (simplified educational diagram, original illustration)

Where trims come from

The ECU works out how much air is entering the engine from a MAF sensor, or from manifold pressure, intake temperature and rpm on speed-density systems. It divides that air mass by the target air-fuel ratio to get a base injection time. Once the engine is warm and running at idle or part load, the upstream lambda sensor closes the loop: if the exhaust reads lean, fuel is added; if it reads rich, fuel is taken away. Cold start, full-load enrichment and overrun fuel cut normally run open loop.

STFT is the immediate response and moves constantly. LTFT is the learned part: when STFT sits on one side of zero for long enough, that correction is moved into long-term memory so it is applied from the start. Many ECUs learn an additive offset that dominates at idle and a multiplicative factor that dominates at part load, so a fault can show in one zone and not the other.

Reading the numbers correctly

  1. Warm the engine fully and confirm closed loop status in live data. Trims recorded in open loop mean little.
  2. Add STFT and LTFT. A +15% LTFT with −12% STFT nets about +3%: the ECU is backing off an earlier learned correction, as often happens just after a repair or with an intermittent fault.
  3. Test three conditions: idle, a steady 2,500 rpm without load, and a road or load test. Note how the total changes.
  4. Compare banks on V and boxer engines. Bank 1 is the side containing cylinder 1.

As a commonly quoted rule of thumb, totals within about ±10% are usually considered normal, and many ECUs set lean or rich codes somewhere around ±20–25%. These are rough guides; actual limits are calibration-specific.

Illustrative chart of total fuel trim at idle, 2,500 rpm and under load for a vacuum leak, fuel delivery fault, contaminated MAF, rich fault and a healthy engine (no real measured data)
Reading total fuel trim at idle, 2,500 rpm and under load (illustrative) (simplified educational diagram, original illustration)

Lean trims: the usual suspects

  • High at idle, near normal at 2,500 rpm: unmetered air. Smoke-test the intake, check PCV hoses, brake-booster lines, injector seals and intake gaskets.
  • Getting worse with load: fuel supply. Measure fuel pressure and volume, check the filter and pump, and look for low rail pressure on direct-injection engines.
  • Lean across the range, both banks: a contaminated or ageing MAF under-reporting air. Compare its reading with expected values for engine size and rpm.
  • One bank only: a restricted injector, a leaking intake runner or an exhaust leak on that bank. An exhaust leak ahead of the sensor lets in oxygen, so the ECU adds fuel while the engine is actually running richer.

Rich trims: what to check

  • Leaking or dripping injectors, or fuel pressure above specification.
  • A purge valve stuck open, typically worst at idle after refuelling, though an empty canister can make it act like an air leak instead.
  • A MAF over-reading, or a coolant temperature sensor reporting falsely cold and adding enrichment.
  • A slow or biased upstream sensor, which makes the trims correct to a wrong signal.

Clear the learning after repair

LTFT keeps the old correction after a fix. Reset fuel adaptations with a scan tool where the function exists, clear codes, and complete a drive with idle and steady part-load sections so the ECU relearns. Confirm the totals return close to zero.

Chart comparing closed-loop fuel trim on cars and vans, LPG and CNG vans and trucks, petrol agricultural and utility machines, and motorbikes
Closed-loop fuel trim across vehicle types (simplified educational diagram, original illustration)

Notes by vehicle type

Cars and vans expose trims in standard OBD data. On LPG and CNG conversions, compare trims on petrol and on gas; large differences mean the gas map needs adjusting. Dedicated gas engines in trucks and vans run their own lambda control with similar logic. Petrol ag and utility machines range from carburetted engines with no feedback to EFI UTVs and generators with closed loop. Motorcycles often run closed loop only at idle and cruise, so header-gasket leaks and aftermarket exhausts show up quickly.

Trims after a remap

A well-made calibration should leave trims small. Large LTFT changes after a file change point to an airflow or fuel model issue, or a fault that already existed. Record trims before and after, and use wideband logging at full load, where closed loop is inactive.

Related fault codes (DTCs)

Generic OBD-II codes per SAE J2012 (bank 1 / bank 2 pairs shown together). Wording and setting conditions vary by manufacturer.

CodeMeaningTypical causes
P0170 / P0173Fuel Trim Malfunction (Bank 1 / Bank 2)Trims beyond the learned limit: air leak, fuel delivery, MAF or sensor fault
P0171 / P0174System Too Lean (Bank 1 / Bank 2)Vacuum leak, contaminated MAF, low fuel pressure, restricted injectors, exhaust leak ahead of the sensor; both together suggest a shared cause
P0172 / P0175System Too Rich (Bank 1 / Bank 2)Leaking injector, high fuel pressure, purge valve stuck open, MAF over-reading
P2177 / P2179System Too Lean Off Idle (Bank 1 / Bank 2)Fuel delivery limits, MAF under-reading, restricted injectors
P2178 / P2180System Too Rich Off Idle (Bank 1 / Bank 2)High fuel pressure, leaking injectors, MAF over-reading
P2187 / P2189System Too Lean at Idle (Bank 1 / Bank 2)Vacuum, PCV or brake-booster hose leaks, intake gasket
P2188 / P2190System Too Rich at Idle (Bank 1 / Bank 2)Purge vapour at idle, leaking injector
P0101Mass or Volume Air Flow Circuit Range/PerformanceContaminated or failing MAF, air leak after the MAF, plausibility error against the airflow model
P0130O2 Sensor Circuit (Bank 1 Sensor 1)Upstream sensor or wiring fault, so trims chase a false signal
P0133O2 Sensor Circuit Slow Response (Bank 1 Sensor 1)Ageing or contaminated upstream sensor, nearby exhaust leak
P0441Evaporative Emission System Incorrect Purge FlowPurge valve stuck or leaking, blocked or split purge lines
P0496Evaporative Emission System High Purge FlowPurge valve stuck open, often with rich or erratic idle trims
P0087Fuel Rail/System Pressure Too LowWeak pump, blocked filter, faulty regulator or high-pressure pump

Closing

Read fuel trims by load, by bank and as a total, and lean or rich codes stop being guesswork.

Looking for an original file or an engineered calibration? Browse the ECUFlashFiles shop.