A flat-12 is an internal combustion engine in a flat configuration, having 12 cylinders.
The flat-12 is wider (but significantly lower in height) than a V12 . Despite the advantage of having a lower center of gravity than a V12, that advantage can be somewhat offset by the need for a higher mounting height in the engine bay to provide clearance for the exhaust system (six runners on either side). Whereas a V12 can be used in front-engined or mid-engined applications, a flat-12 is used exclusively in mid-engined sports cars. In addition, because it has no advantage in terms of vibrations compared to the more commonly used V-12, the design is rarely used on production cars.
Flat-12 engines are generally not true horizontally opposed engines (boxer), but rather 180° V-engines. A true boxer has one crank pin per piston, while in the 180° V-engine, two opposing pistons share the same crank pin.
The flat design was used in Formula One and Endurance racing. However, when wing-cars requiring air-flow venturis came along in the late 1970s, the wide, flat layout obstructed the airflow and became obsolete.
The Porsche 917 endurance racing car (introduced in 1969, for the Sport category) was powered by an air-cooled flat-12. This engine was an evolution of the Porsche flat-8 boxer engine and used identical cylinders to those found on the 908, but differed in that it used a V12 type crankshaft.
The domination of the Porsche 917 over the V12-powered Ferrari 512 probably influenced Ferrari, because they returned to the flat-12 in 3 litre water-cooled form for their prototypes and Formula One cars.
The Ferrari flat-12 design was successful and influential especially on Italian manufacturers, including Alfa Romeo, who were also successful in endurance racing with a flat-12. The Tecno Formula One flat-12 was a failure, however.
Motori Moderni designed a 3.5 litre flat-12 engine for Subaru, which would be used in the 1990 Coloni Formula One car. The Coloni−Subaru was not competitive and did not start a Grand Prix. The Motori Moderni flat-12 engine also appeared in detuned form in the Jiotto Caspita supercar. This only appeared in a single prototype and was not put into production.
In the early 1990s, Mercedes-Benz built their 3.5 litre M-291 flat-12 engine for endurance racing. This engine employed a clever cylinder-head design in which the exhaust ports are located where the intake ports would normally be (on top of the engine, pointing upwards). The intake ports are then re-located between the intake and exhaust camshafts, just above the spark-plugs, pointing at an outward angle from the vertical. By locating the entire exhaust system on top, rather than underneath the engine, a much lower mounting height was achieved for this engine in the engine-bay of their racing car, the C-291 (and later C-292). Unfortunately, the engine suffered from oil scavenging problems early on in its development, and although the problem was eventually solved, changes in the rules by FIA and ACO effectively doomed the future prospects of what could otherwise have been a competitive engine.