Home / Journal / Car model guides

Car model guides

BMW M340i (G20) engine: which one, problems and replacement

Which engine is in the BMW M340i G20? B58B30, B58B30TU and B58B30M1: specs, known problems, swaps and replacement prices from 3.606,00 €.

BMW G20 M340i B58B30M1 Engine 2020, 164,300 km — photo 1

The BMW M340i in the seventh 3 Series generation (G20, built 2018–) was built with 3 different engines over its life: the B58B30 (340 hp, 2015–2026), the B58B30TU (374 hp, 2018–2026) and the B58B30M1 (374 hp, 2019–2026).

Below you will find how to identify the engine in your M340i, the faults to look for, current prices for a replacement and the swap options that make sense.

  • Generation: seventh 3 Series, 2018–
  • Body styles: G20 (saloon)
  • Engines: B58B30, B58B30TU, B58B30M1
  • Output: 340 hp and 374 hp
  • Replacement engines in stock: 457 from 3.606,00 €
BMW G20 M340i B58B30M1 Engine 2025, 99,400 km — photo 1
BMW G20 M340i B58B30M1 Engine 2025, 99,400 km — 5.882,00 €

Which engine is in your M340i?

Engines fitted to the BMW M340i (G20)
Engine codeBuiltPowerTorqueType
B58B302015–2026340 hp500 Nm3.0 L petrol inline-6, turbocharged
B58B30TU2018–2026374 hp500 Nm3.0 L petrol inline-6, turbocharged
B58B30M12019–2026374 hp500 Nm3.0 L petrol inline-6, turbocharged

B58B30 in the M340i

The B58B30 was used in the G20 M340i, built 2015–2026. It is a 3.0 L turbocharged petrol inline-6 with 340 hp and 500 Nm. Compared with the B58B30TU (374 hp) and B58B30M1 (374 hp), it is the mildest.

Reading the code: B marks a B-series code, BMW's modular engine family introduced from 2013 with 500 cc per cylinder; 58 is the family number; B stands for petrol, longitudinal installation for rear-drive and xDrive cars; 30 is the capacity in decilitres, so 3.0 litres.

B58B30TU in the M340i

The B58B30TU was used in the G20 M340i, built 2018–2026. It is a 3.0 L turbocharged petrol inline-6 with 374 hp and 500 Nm. Compared with the B58B30 (340 hp) and B58B30M1 (374 hp), it is in between.

Reading the code: B marks a B-series code, BMW's modular engine family introduced from 2013 with 500 cc per cylinder; 58 is the family number; B stands for petrol, longitudinal installation for rear-drive and xDrive cars; 30 is the capacity in decilitres, so 3.0 litres; TU identifies the technical update.

BMW G20 M340i B58B30M1 Engine 2021, 103,500 km — photo 1
BMW G20 M340i B58B30M1 Engine 2021, 103,500 km — 6.295,00 €

B58B30M1 in the M340i

The B58B30M1 was used in the G20 M340i, built 2019–2026. It is a 3.0 L turbocharged petrol inline-6 with 374 hp and 500 Nm. Compared with the B58B30 (340 hp) and B58B30TU (374 hp), it is in between.

Reading the code: B marks a B-series code, BMW's modular engine family introduced from 2013 with 500 cc per cylinder; 58 is the family number; B stands for petrol, longitudinal installation for rear-drive and xDrive cars; 30 is the capacity in decilitres, so 3.0 litres; M1 identifies the version or output stage.

Other cars with the same engine as the M340i

A replacement engine does not have to come from another M340i. These models left the factory with the same engine code, so a unit from any of them is a candidate donor once the sump, mounts and ancillaries are matched to your car.

B58B30: BMW F30 340i, BMW G30 540i, BMW G05 X5 40i, BMW G29 Z4 M40i, Supra 3.0.

B58B30TU: BMW G30 540i, BMW G05 X5 40i, BMW G42 M240i.

B58B30M1: BMW G29 Z4 M40i, Toyota A90 Supra.

How to confirm your engine code

Because the M340i used more than one engine, the badge alone does not tell you which one your car has. The build date is the first clue; the VIN is the proof. Send us the last seven characters of the VIN and we read the engine code from BMW's records, or look for the code stamped on the block. How to find your BMW engine code.

Known M340i engine problems

The B58B30, B58B30TU and B58B30M1 in the M340i share the known weak points of the B58 family. Full B58 guide.

Known faultWhat to check
Coolant leaksCheck for coolant loss.
Oil filter housingCheck below the housing.
PCV valveLook for oil in the intake.

Coolant leaks. Expansion tanks and coolant lines leak.

Oil filter housing. The plastic oil filter housing can leak.

PCV valve. The PCV in the valve cover can fail.

Symptoms to watch for on the M340i

Rattle for a few seconds after a cold start. The classic sign of a weak timing chain tensioner or stretched chain. It must be checked quickly: a chain that jumps a tooth can bend valves.

Rattle or whine from the gearbox end. On engines with the timing chain at the rear, a rattle or whine from the back of the engine is the warning sign of chain stretch or guide wear.

Whistle, loss of boost or limp mode. A split charge pipe, a sticking wastegate or worn turbo bearings. Check the pipes first, then the turbo shaft for play.

Poor low-down torque and uneven idle. VANOS seals or solenoids. The engine may run well at high revs but feel flat and lumpy at low speed.

Limp mode with a Valvetronic fault. The Valvetronic motor, its eccentric shaft sensor or the wiring. The engine runs on a reduced throttle until it is repaired.

Long cranking before the engine starts. On direct-injection engines, a weak high-pressure fuel pump or leaking injector lets pressure drop when the engine is off.

Looking after the M340i engine

  • Oil: 0W-30 BMW Longlife-01 or 17 FE+, about 6.5 litres.
  • Service interval: Oil every 15,000 km or yearly.
  • Timing drive: Timing chain at the rear (gearbox end).
  • Workshop notes: Check the version (B58B30M0, M1 or TU) before ordering.

Buying a used engine for the M340i: checklist

  1. Confirm the exact engine code. Read the code stamped on the block and compare it with the code for your car. Send us the last seven characters of the VIN and we confirm the match before anything is paid.
  2. Why your old engine failed. Before fitting a replacement, find out why the original failed. An overheating radiator, a blocked intercooler or a failed turbo can destroy a second engine if they are not fixed.
  3. Compression or leak-down figures. Even compression across all cylinders tells you more than mileage. Ask for the figures, not just a pass or fail, and compare the highest and lowest readings: a spread above 10 to 15 percent deserves a question.
  4. Gearbox and flywheel match. Manual and automatic engines differ at the flywheel or flexplate, and sometimes at the crankshaft spigot. Make sure the engine you buy matches your gearbox or that you transfer the right parts.
  5. List of what is fitted. Engines are sold with different ancillaries: some have the turbo, injectors, manifolds, alternator and starter, others are long blocks. Agree the list in writing so you know which parts must come from your old engine.
  6. Turbocharger shaft play and oil. Rotate the compressor wheel by hand. A small amount of side play is normal; in-and-out play or wheel contact with the housing is not. Oil pooled in the intake or intercooler pipes points to worn seals.
  7. Timing chain noise. Listen for a rattle at the front of the engine for the first seconds after a cold start. On an engine that cannot be run, look at the chain guides through the oil filler or with the valve cover off.
  8. Gearbox-end timing chain. On this engine the timing chain sits at the gearbox end, so replacing it normally means removing the engine. If the chain has not been replaced, the time to do it is before the engine goes into your car.
  9. VANOS operation. Rough idle, a rattle from the front of the head and a loss of torque at low revs point to VANOS seals or solenoids. These are serviceable parts and are easier to renew with the engine out.
  10. Double VANOS units and solenoids. Ask for the adaptation values or fault history if the engine was running. Solenoids are inexpensive and are often replaced as a matter of course on a used engine.
  11. Valvetronic motor and eccentric shaft sensor. The Valvetronic motor and its sensor cause limp-mode faults when they fail. Inspect the connector and the seal around the motor for oil.
  12. Injectors and high-pressure fuel pump. Direct-injection engines rely on high-pressure pumps and precise injectors. Ask whether the injectors are original or updated and whether there were fuel pressure faults.

BMW M340i replacement engine cost

Our M340i engine stock runs to 457 units, priced from 3.606,00 € to 8.142,00 € with a median of 5.907,00 €.

Prices depend on the exact version, the donor's mileage, how complete the engine is and the demand for that code. Higher-output versions, low mileage and dressed engines with turbo, injectors and ancillaries cost more; long blocks and higher mileage cost less.

M340i engine prices by model year

Model yearsUnitsFromMedianTo
2015–20192304.214,00 €5.518,00 €7.712,00 €
2020–20241794.270,00 €6.388,00 €7.976,00 €
2025–2029325.285,00 €6.613,00 €7.936,00 €

Engines from 2015–2019 have a median of 5.518,00 €, while units from 2025–2029 sit at 6.613,00 €. Newer engines usually cost more because they come from younger donor cars with lower mileage and later updates.

M340i engine prices by mileage

Donor mileageUnitsFromMedian
under 50,000 km614.404,00 €5.919,00 €
50,000 to 100,000 km1114.224,00 €5.882,00 €
100,000 to 150,000 km1194.298,00 €5.970,00 €
over 150,000 km1494.214,00 €5.875,00 €

Mileage matters less than history on a well-maintained BMW engine, but it is a useful guide. A low-mileage unit from a younger car gives you more life for a modest premium.

47 of these come from G20 donor cars, priced from 3.730,00 € to 8.132,00 €. An engine from the same body is the most direct swap because the sump, mounts and ancillaries already match.

On top of the engine, budget for the workshop's labour and the parts that are best replaced while the engine is out: engine mounts, the rear main seal, cooling parts, a clutch or converter seal, fluids and filters.

Replacement engines in stock for the M340i

Here is a selection of M340i engines currently on our shelves, photographed in the yard. Click any of them for the full photographs, mileage and specification.

BMW G20 M340i B58B30M1 Engine 2024, 137,200 km — 7.541,00 €, reduced from 8.200,00 €. It comes from a 2024 donor car with 137,200 km, and 22 units are available. We can confirm fitment against your VIN the same day.

BMW G20 M340i B58B30M1 Engine 2022, 36,400 km — 5.811,00 €, reduced from 7.050,00 €. It comes from a 2022 donor car with 36,400 km, and 17 units are available. Ask the desk for compression figures or extra photographs before you order.

BMW G20 M340i B58B30M1 Engine 2021, 53,300 km — 5.500,00 €, reduced from 6.550,00 €. It comes from a 2021 donor car with 53,300 km, and 9 units are available. The listing shows every side of the engine and the fitted parts.

BMW G20 M340i B58B30M1 Engine 2019, 64,400 km — 6.578,00 €, reduced from 8.050,00 €. It comes from a 2019 donor car with 64,400 km, and 25 units are available. We can confirm fitment against your VIN the same day.

BMW G20 M340i B58B30M1 Engine 2021, 194,400 km — 7.778,00 €, reduced from 9.250,00 €. It comes from a 2021 donor car with 194,400 km, and 29 units are available. We can confirm fitment against your VIN the same day.

BMW G20 M340i B58B30M1 Engine 2023, 108,100 km — 7.144,00 €, reduced from 7.750,00 €. It comes from a 2023 donor car with 108,100 km, and 28 units are available. The listing shows every side of the engine and the fitted parts.

BMW G20 M340i B58B30M1 Engine 2025, 55,600 km — 7.129,00 €, reduced from 8.600,00 €. It comes from a 2025 donor car with 55,600 km, and 22 units are available. Ask the desk for compression figures or extra photographs before you order.

BMW G20 M340i B58B30M1 Engine 2019, 43,000 km — 5.384,00 €, reduced from 6.000,00 €. It comes from a 2019 donor car with 43,000 km, and 27 units are available. The listing shows every side of the engine and the fitted parts.

BMW G20 M340i B58B30M1 Engine 2019, 72,400 km — 5.484,00 €, reduced from 6.200,00 €. It comes from a 2019 donor car with 72,400 km, and 22 units are available. We can confirm fitment against your VIN the same day.

BMW G20 M340i B58B30M1 Engine 2019, 103,800 km — 6.227,00 €, reduced from 7.450,00 €. It comes from a 2019 donor car with 103,800 km, and 27 units are available. The listing shows every side of the engine and the fitted parts.

BMW G20 M340i B58B30M1 Engine 2023, 37,300 km — 6.771,00 €, reduced from 7.750,00 €. It comes from a 2023 donor car with 37,300 km, and 22 units are available. The listing shows every side of the engine and the fitted parts.

BMW G20 M340i B58B30M1 Engine 2025, 179,200 km — 6.175,00 €, reduced from 7.050,00 €. It comes from a 2025 donor car with 179,200 km, and 9 units are available. The listing shows every side of the engine and the fitted parts.

Will it fit my M340i?

Will the B58B30 fit my BMW G20 M340i?

The B58B30 is the original engine for the BMW G20 M340i, which makes it the straightforward choice. The seventh 3 Series was built 2018–, and the B58B30 was produced 2015–2026, so check that your car's build date falls inside that window. Confirm the drive type (rear-drive or xDrive), the gearbox (manual or automatic) and the emissions standard, because these can change the sump, the flywheel and the software. Send us the VIN and we check all of it for you.

How much is a replacement engine for a BMW G20 M340i?

We have 47 B58B30 engines from G20 donor cars, priced from 3.730,00 € to 8.132,00 €. Delivery to your door is included, and the engine carries a 12-month warranty when fitted by a qualified workshop. Add fitting labour and the parts you replace at the same time — seals, cooling parts and mounts — to estimate the total.

Will the B58B30TU fit my BMW G20 M340i?

For the BMW G20 M340i, the B58B30TU is the factory engine and the one to order. The seventh 3 Series was built 2018–, and the B58B30TU was produced 2018–2026, so check that your car's build date falls inside that window. Confirm the drive type (rear-drive or xDrive), the gearbox (manual or automatic) and the emissions standard, because these can change the sump, the flywheel and the software. Send us the VIN and we check all of it for you.

How much is a replacement engine for a BMW G20 M340i?

We have 1 B58B30TU engine from G20 donor cars, priced from 8.132,00 €. Delivery to your door is included, and the engine carries a 12-month warranty when fitted by a qualified workshop. Add fitting labour and the parts you replace at the same time — seals, cooling parts and mounts — to estimate the total.

Fitting a replacement engine in the M340i

  1. Inspect or replace the timing chain parts. Look at the guides and tensioner. On high-mileage engines, replacing them now costs far less than doing it later.
  2. Replace the rear timing chain if in doubt. On engines with the chain at the gearbox end, chain work needs the engine out. If the history is unknown, replace the chain, guides and tensioner before fitting.
  3. Prepare the turbo. Fit new oil feed and return seals, clean the intercooler and pipes of any oil or debris from the old engine, and prime the turbo with oil before starting.
  4. Reset VANOS adaptations. Clear the VANOS adaptations so the ECU learns the camshaft positions of the new engine.
  5. Teach the Valvetronic limit stops. Run the Valvetronic learning routine so the ECU knows the eccentric shaft limits.
  6. Fill with the right oil and prime it. Fill with new oil of the correct specification and a new filter. Crank with the fuel and ignition disabled until oil pressure builds.
  7. Coding and adaptations. On modern BMWs, the engine ECU must be matched to the car's immobiliser (CAS, FEM or BDC). Reset adaptations, register the battery and clear faults with diagnostic software.
  8. First start and leak check. Start the engine, let it idle and watch oil pressure, temperature and fault codes. Check for leaks and bleed the cooling system.
  9. First 1,000 km. Drive gently for the first few hundred kilometres, vary the engine speed and avoid full load. Change the oil and filter after about 1,000 km to remove any assembly debris.

The full fitting and first-start procedure.

M340i engine questions

How long does delivery of a B58B30M1 engine take?

Orders confirmed before 14:00 CET on a working day leave Hamburg the same day. Later and weekend orders leave the next working day. Delivery to the Netherlands, Belgium, Germany, France, Luxembourg and Denmark takes 1 to 3 working days.

Spain, Italy, Portugal, Poland, Czechia, Austria, Ireland, the Nordics and the Baltics take 2 to 5 working days. Greek and Spanish islands, Malta, Cyprus and remote areas take 4 to 8 working days. The UK and other countries outside the EU are quoted one by one.

Shipping is a flat 249 € per order. It is added once at checkout and printed on the invoice, so there is no extra fee later. Every engine is drained, sealed at each opening, strapped to a heat-treated pallet and shrink-wrapped, then photographed before it leaves the yard.

You get a tracking number when the pallet is collected. Check the wrapping before you sign, and note any damage on the paperwork.

See all B58 Engines · Search B58B30M1 in the shop

BMW G20 M340i B58B30M1 Engine 2024, 63,000 km — photo 1
BMW G20 M340i B58B30M1 Engine 2024, 63,000 km — 5.542,00 €

Will the B58B30 engine fit my BMW G05 X5 xDrive40i?

Yes, if your BMW G05 X5 xDrive40i was built with the B58B30. BMW used this 3.0 liter (2,998 cc) petrol engine with 250 kW (340 HP) in the G05 X5 xDrive40i from about 2015 to 2020.

Some G05 X5 xDrive40i cars were built with a different engine: the B58B30M1. These look alike from the outside, so check the code on your engine or send us your VIN.

Your car has all-wheel drive or is an X model, so the sump, the oil pickup and some brackets can differ from the rear-drive cars. Tell us the full model so we send the right set-up.

Not sure? Send us your VIN and your gearbox code. We match the engine family, the year window and the parts on the engine before anything is reserved, and the check is free.

See all B58 Engines · Search B58B30 in the shop

Does a used B58B30M1 engine come with a warranty?

Yes. Eligible engines come with a 12 months warranty from the delivery date. It covers internal mechanical failure under normal use and correct fitting by a qualified mechanic or workshop.

The warranty does not cover damage from wrong fitting, overheating, low oil, wrong fluids or fuel, engines that were opened or modified without our approval, or labour and towing costs.

To claim, send us your order number, a short description of the problem, photos or a video, and a mechanic's report if we ask for one. If the claim is approved, we repair, replace or refund the engine.

Keep the receipts for the fitting, the oil and the filters. They make any claim quick and simple.

See all B58 Engines · Search B58B30M1 in the shop

Will the B58B30 engine fit my BMW G01 X3 M40i?

Yes, if your BMW G01 X3 M40i was built with the B58B30. BMW used this 3.0 liter (2,998 cc) petrol engine with 250 kW (340 HP) in the G01 X3 M40i from about 2015 to 2020.

Some G01 X3 M40i cars were built with a different engine: the B58B30M1. These look alike from the outside, so check the code on your engine or send us your VIN.

Your car has all-wheel drive or is an X model, so the sump, the oil pickup and some brackets can differ from the rear-drive cars. Tell us the full model so we send the right set-up.

Not sure? Send us your VIN and your gearbox code. We match the engine family, the year window and the parts on the engine before anything is reserved, and the check is free.

See all B58 Engines · Search B58B30 in the shop

Does a used B58B30 engine come with a warranty?

Yes. Eligible engines come with a 12 months warranty from the delivery date. It covers internal mechanical failure under normal use and correct fitting by a qualified mechanic or workshop.

The warranty does not cover damage from wrong fitting, overheating, low oil, wrong fluids or fuel, engines that were opened or modified without our approval, or labour and towing costs.

To claim, send us your order number, a short description of the problem, photos or a video, and a mechanic's report if we ask for one. If the claim is approved, we repair, replace or refund the engine.

Keep the receipts for the fitting, the oil and the filters. They make any claim quick and simple.

See all B58 Engines · Search B58B30 in the shop

Which cars use the BMW B58B30 engine?

BMW fitted the B58B30 to the BMW F30 340i, BMW G30 540i, BMW G11 740i, BMW G05 X5 xDrive40i and BMW G01 X3 M40i. These cars were built with this engine from about 2015 to 2020.

The badge on the boot is not enough to be sure. The same model name can hide two different engines, for example after a facelift or a change in emission rules. Always read the engine code stamped on the block, or look it up with your VIN.

Other engines in the same B58 family are the B58B30M1 (374 HP). They look alike but differ in power, parts and electronics, so they are not always a direct swap.

Not sure? Send us your VIN and your gearbox code. We match the engine family, the year window and the parts on the engine before anything is reserved, and the check is free.

See all B58 Engines · Search B58B30 in the shop

What comes with a used B58B30 engine?

Each B58B30 is sold as described on its own listing. The yard writes down the parts that are fitted to that unit, such as the turbo, the injectors, the manifolds or the alternator, so you know what arrives.

Some units are long engines with few ancillaries, others are more complete. If you need a part that is not listed, ask the desk. We often have the matching items in the yard.

Every engine is drained, sealed at each opening, strapped to a heat-treated pallet and shrink-wrapped, then photographed before it leaves the yard.

On delivery, the carrier brings the pallet to the kerb or a loading bay. Please have a forklift, a pallet truck or an engine crane ready.

See all B58 Engines · Search B58B30 in the shop

What comes with a used B58B30M1 engine?

Each B58B30M1 is sold as described on its own listing. The yard writes down the parts that are fitted to that unit, such as the turbo, the injectors, the manifolds or the alternator, so you know what arrives.

Some units are long engines with few ancillaries, others are more complete. If you need a part that is not listed, ask the desk. We often have the matching items in the yard.

Every engine is drained, sealed at each opening, strapped to a heat-treated pallet and shrink-wrapped, then photographed before it leaves the yard.

On delivery, the carrier brings the pallet to the kerb or a loading bay. Please have a forklift, a pallet truck or an engine crane ready.

See all B58 Engines · Search B58B30M1 in the shop

BMW G20 M340i B58B30M1 Engine 2019, 43,000 km — photo 1
BMW G20 M340i B58B30M1 Engine 2019, 43,000 km — 5.384,00 €

Will the B58B30M1 engine fit my BMW G05 X5 xDrive40i?

Yes, if your BMW G05 X5 xDrive40i was built with the B58B30M1. BMW used this 3.0 liter (2,998 cc) petrol engine with 275 kW (374 HP) in the G05 X5 xDrive40i from about 2019 to 2026.

Some G05 X5 xDrive40i cars were built with a different engine: the B58B30. These look alike from the outside, so check the code on your engine or send us your VIN.

Your car has all-wheel drive or is an X model, so the sump, the oil pickup and some brackets can differ from the rear-drive cars. Tell us the full model so we send the right set-up.

Not sure? Send us your VIN and your gearbox code. We match the engine family, the year window and the parts on the engine before anything is reserved, and the check is free.

See all B58 Engines · Search B58B30M1 in the shop

How much power and torque does the BMW B58B30M1 have?

From the factory the BMW B58B30M1 makes 275 kW (374 HP) and 500 Nm of torque. It is a 3.0 liter (2,998 cc) inline 6, DOHC, 24 valve petrol engine with a twin-scroll turbocharger.

Because it is turbocharged, the torque comes in low in the rev range, which makes the car feel strong in everyday driving. A healthy turbo, a clean intercooler and tight boost pipes are key to getting the full figure.

A used engine reaches its factory numbers when it is fitted with the matching engine computer and software, and serviced with the right oil and filters. If the engine computer from your car is a different version, a specialist may need to code it.

Every B58B30M1 on our site lists its year and mileage. Ask the desk for more pictures of any listing. We are happy to show the stamp, the ports and the ancillaries before you decide.

See all B58 Engines · Search B58B30M1 in the shop

Delivery, warranty and payment

Every M340i engine we sell is drained, sealed at each opening, strapped to a heat-treated pallet and shrink-wrapped before it leaves Hamburg. You receive photographs of the packed engine and a tracking number.

Door-to-door delivery is included to the address you give at checkout. Typical delivery takes three to five working days within Germany and neighbouring countries and five to ten working days to the rest of Europe and the UK.

A 12-month warranty covers eligible internal failure when the engine is fitted by a qualified workshop with new fluids and filters. You can pay by card, bank transfer or crypto and receive the invoice by email straight away.

All G20 engines · B58 engine guide · BMW M340i engines for sale · Send us your VIN