The BMW 540i in the seventh 5 Series generation (G30, built 2016–2023) was built with 3 different engines over its life: the B58B30 (340 hp, 2015–2026), the B58B30M0 (340 hp, 2016–2023) and the B58B30TU (374 hp, 2018–2026).
Below you will find how to identify the engine in your 540i, the faults to look for, current prices for a replacement and the swap options that make sense.
- Generation: seventh 5 Series, 2016–2023
- Body styles: G30 (saloon)
- Engines: B58B30, B58B30M0, B58B30TU
- Output: 340 hp and 374 hp
- Replacement engines in stock: 237 from 3.098,00 €

Which engine is in your 540i?
| Engine code | Built | Power | Torque | Type |
|---|---|---|---|---|
| B58B30 | 2015–2026 | 340 hp | 500 Nm | 3.0 L petrol inline-6, turbocharged |
| B58B30M0 | 2016–2023 | 340 hp | 450 Nm | 3.0 L petrol inline-6, turbocharged |
| B58B30TU | 2018–2026 | 374 hp | 500 Nm | 3.0 L petrol inline-6, turbocharged |
B58B30 in the 540i
The B58B30 was used in the G30 540i, built 2015–2026. It is a 3.0 L turbocharged petrol inline-6 with 340 hp and 500 Nm. Compared with the B58B30M0 (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.
B58B30M0 in the 540i
The B58B30M0 was used in the G30 540i, built 2016–2023. It is a 3.0 L turbocharged petrol inline-6 with 340 hp and 450 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; M0 identifies the version or output stage.

B58B30TU in the 540i
The B58B30TU was used in the G30 540i, 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 B58B30M0 (340 hp), it is the strongest.
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.
540i engines by model year
| Model year | Engine |
|---|---|
| 2016 | B58B30 (340 hp), B58B30M0 (340 hp) |
| 2017 | B58B30 (340 hp), B58B30M0 (340 hp) |
| 2018 | B58B30 (340 hp), B58B30M0 (340 hp), B58B30TU (374 hp) |
| 2019 | B58B30 (340 hp), B58B30M0 (340 hp), B58B30TU (374 hp) |
| 2020 | B58B30 (340 hp), B58B30M0 (340 hp), B58B30TU (374 hp) |
| 2021 | B58B30 (340 hp), B58B30M0 (340 hp), B58B30TU (374 hp) |
| 2022 | B58B30 (340 hp), B58B30M0 (340 hp), B58B30TU (374 hp) |
| 2023 | B58B30 (340 hp), B58B30M0 (340 hp), B58B30TU (374 hp) |
The engine changed once during the G30 run, in 2018. Changes usually come with BMW's mid-life update (LCI) or a new emissions standard, so a car registered early in a year can still have the older engine. The VIN settles it.
Other cars with the same engine as the 540i
A replacement engine does not have to come from another 540i. 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 G20 M340i, BMW G05 X5 40i, BMW G29 Z4 M40i, Supra 3.0.
B58B30M0: BMW G11 740i, BMW G05 X5 40i.
B58B30TU: BMW G20 M340i, BMW G05 X5 40i, BMW G42 M240i.
How to confirm your engine code
Because the 540i 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 540i engine problems
The B58B30, B58B30M0 and B58B30TU in the 540i share the known weak points of the B58 family. Full B58 guide.
| Known fault | What to check |
|---|---|
| Coolant leaks | Check for coolant loss. |
| Oil filter housing | Check below the housing. |
| PCV valve | Look 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 540i
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 540i 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 540i: checklist
- 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.
- Photographs from every side. Good suppliers photograph the actual engine you will receive. Look for the block stamp, the sump, the timing cover and any broken brackets or connectors in the pictures.
- Sump, oil pickup and drive variants. Rear-drive, xDrive and front-drive cars can use different sumps, oil pickups and engine mounts even with the same engine code. Check that the sump matches your subframe and front axle.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 540i replacement engine cost
Our 540i engine stock runs to 237 units, priced from 3.098,00 € to 8.142,00 € with a median of 5.352,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.
540i engine prices by model year
| Model years | Units | From | Median | To |
|---|---|---|---|---|
| 2015–2019 | 199 | 4.214,00 € | 5.328,00 € | 6.499,00 € |
| 2020–2024 | 22 | 4.270,00 € | 5.237,00 € | 6.268,00 € |
Engines from 2015–2019 have a median of 5.328,00 €, while units from 2020–2024 sit at 5.237,00 €. Newer engines usually cost more because they come from younger donor cars with lower mileage and later updates.
540i engine prices by mileage
| Donor mileage | Units | From | Median |
|---|---|---|---|
| under 50,000 km | 26 | 4.404,00 € | 5.669,00 € |
| 50,000 to 100,000 km | 52 | 4.224,00 € | 5.127,00 € |
| 100,000 to 150,000 km | 62 | 4.298,00 € | 5.430,00 € |
| over 150,000 km | 80 | 4.214,00 € | 5.478,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.
3 of these come from G30 donor cars, priced from 3.121,00 € to 8.124,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 540i
Here is a selection of 540i engines currently on our shelves, photographed in the yard. Click any of them for the full photographs, mileage and specification.
BMW G11 740i B58B30 Engine 2019, 132,500 km4.988,00 €
BMW G11 740i B58B30 Engine 2018, 162,100 km5.677,00 €
BMW F30 340i B58B30 Engine 2016, 53,000 km5.255,00 €
BMW G11 740i B58B30 Engine 2017, 138,300 km5.970,00 €
BMW F32 440i B58B30 Engine 20174.322,00 €
BMW G11 740i B58B30 Engine 2016, 154,000 km6.404,00 €
BMW F30 340i B58B30 Engine 2019, 160,800 km5.247,00 €
BMW F30 340i B58B30 Engine 2018, 192,800 km5.225,00 €
BMW G11 740i B58B30 Engine 2016, 196,800 km5.522,00 €
BMW G11 740i B58B30 Engine 2016, 18,100 km5.703,00 €
BMW F30 340i B58B30 Engine 2018, 99,700 km5.598,00 €
BMW F30 340i B58B30 Engine 2015, 115,800 km5.515,00 €BMW G11 740i B58B30 Engine 2019, 132,500 km — 4.988,00 €, reduced from 5.750,00 €. It comes from a 2019 donor car with 132,500 km, and 21 units are available. We can confirm fitment against your VIN the same day.
BMW G11 740i B58B30 Engine 2018, 162,100 km — 5.677,00 €, reduced from 6.850,00 €. It comes from a 2018 donor car with 162,100 km, and 28 units are available. The listing shows every side of the engine and the fitted parts.
BMW F30 340i B58B30 Engine 2016, 53,000 km — 5.255,00 €, reduced from 6.000,00 €. It comes from a 2016 donor car with 53,000 km, and 14 units are available. The listing shows every side of the engine and the fitted parts.
BMW G11 740i B58B30 Engine 2017, 138,300 km — 5.970,00 €, reduced from 6.950,00 €. It comes from a 2017 donor car with 138,300 km, and 18 units are available. We can confirm fitment against your VIN the same day.
BMW F32 440i B58B30 Engine 2017 — 4.322,00 €, reduced from 5.000,00 €. It comes from a 2017 donor car, and 22 units are available. We can confirm fitment against your VIN the same day.
BMW G11 740i B58B30 Engine 2016, 154,000 km — 6.404,00 €, reduced from 7.200,00 €. It comes from a 2016 donor car with 154,000 km, and 30 units are available. The listing shows every side of the engine and the fitted parts.
BMW F30 340i B58B30 Engine 2019, 160,800 km — 5.247,00 €, reduced from 6.500,00 €. It comes from a 2019 donor car with 160,800 km, and 29 units are available. We can confirm fitment against your VIN the same day.
BMW F30 340i B58B30 Engine 2018, 192,800 km — 5.225,00 €, reduced from 6.650,00 €. It comes from a 2018 donor car with 192,800 km, and 21 units are available. The listing shows every side of the engine and the fitted parts.
BMW G11 740i B58B30 Engine 2016, 196,800 km — 5.522,00 €, reduced from 6.400,00 €. It comes from a 2016 donor car with 196,800 km, and 29 units are available. Ask the desk for compression figures or extra photographs before you order.
BMW G11 740i B58B30 Engine 2016, 18,100 km — 5.703,00 €, reduced from 6.950,00 €. It comes from a 2016 donor car with 18,100 km, and 7 units are available. We can confirm fitment against your VIN the same day.
BMW F30 340i B58B30 Engine 2018, 99,700 km — 5.598,00 €, reduced from 6.600,00 €. It comes from a 2018 donor car with 99,700 km, and 29 units are available. We can confirm fitment against your VIN the same day.
BMW F30 340i B58B30 Engine 2015, 115,800 km — 5.515,00 €, reduced from 6.800,00 €. It comes from a 2015 donor car with 115,800 km, and 28 units are available. Ask the desk for compression figures or extra photographs before you order.
Will it fit my 540i?
Will the B58B30M0 fit my BMW G30 540i?
For the BMW G30 540i, the B58B30M0 is the factory engine and the one to order. The seventh 5 Series was built 2016–2023, and the B58B30M0 was produced 2016–2023, 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 G30 540i?
We have 1 B58B30M0 engine from G30 donor cars, priced from 3.121,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 G30 540i?
For the BMW G30 540i, the B58B30TU is the factory engine and the one to order. The seventh 5 Series was built 2016–2023, 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 G30 540i?
We have 1 B58B30TU engine from G30 donor cars, priced from 8.124,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.
Engine swaps and upgrades for the 540i
These engines were fitted to other versions of the G30 at the factory, which makes them the most practical upgrades: the body was designed around them and many parts are shared.
Can I fit the B57D30S in my 540i?
It is a full conversion: the B57D30S runs on diesel and the B58B30TU on petrol, so the fuel system, wiring, engine control unit, instrument coding and usually the gearbox change too. The gain is 26 hp and 260 Nm. In Germany and most of Europe an engine swap must be inspected and registered.
Can I fit the N63B44T3 in my 540i?
It is a conversion rather than a replacement: the N63B44T3 is a V8 and your B58B30TU an inline-6, so mounts, sump, cooling, exhaust, wiring and the engine control unit all change. The gain is 88 hp and 150 Nm. In Germany and most of Europe an engine swap must be inspected and registered.
Fitting a replacement engine in the 540i
- 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.
- 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.
- 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.
- Reset VANOS adaptations. Clear the VANOS adaptations so the ECU learns the camshaft positions of the new engine.
- Teach the Valvetronic limit stops. Run the Valvetronic learning routine so the ECU knows the eccentric shaft limits.
- 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.
- 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.
- 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.
- 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.
540i engine questions
What should I replace when I fit a used B58B30 engine?
A used engine lasts longest when it starts life in your car with fresh fluids and new seals. Fit a new oil filter and fresh oil of the grade BMW lists for this engine, and refill the coolant with the correct BMW antifreeze mix. Clean the intercooler and the intake pipes, and fill the turbo oil feed with clean oil before the first start, so the turbo never runs dry. Change the drive belt, the thermostat and the water pump seals if they look tired, because they are cheap while the engine is out.
Look at the engine mounts and the clutch or the torque converter while the engine is out. Old mounts can crack a new engine's brackets, and a worn clutch is much easier to change now.
Before the first start, turn the engine over without fuel until the oil pressure light goes out. Then let it idle, check for leaks, and drive gently for the first few hundred kilometres.
The warranty asks for fitting by a qualified mechanic and the correct oil, coolant and filters. Keep your receipts in case you ever need to make a claim.
See all B58 Engines · Search B58B30 in the shop

Delivery, warranty and payment
Before a 540i engine leaves our Hamburg yard it is drained of oil and coolant, every opening is sealed, and it is strapped to a pallet and wrapped. We send photographs of the packed unit and the tracking details.
Delivery is door to door and included in the price. Most European addresses receive the engine within five to ten working days; Germany and its neighbours are usually faster.
Every engine carries a 12-month warranty on eligible internal failure when a qualified workshop fits it with new fluids and filters. Payment is by card, bank transfer or crypto; your invoice is emailed as soon as you order.
All G30 engines · B58 engine guide · BMW 540i engines for sale · Send us your VIN






