A railway gun, also called a railroad gun, is a large artillery piece, often surplus naval artillery, mounted on, transported by, and fired from a specially designed railway wagon. Many countries have built railway guns, but the best known are the large Krupp-built pieces used by Germany in World War I and World War II. Smaller guns were often part of an armoured train.
Railway guns have been phased out after World War II.
The design of a railway gun has three issues over and above those of an ordinary artillery piece to consider. Namely how the gun is going to be traversed – i.e. moved from side to side to aim; how the horizontal component of the recoil force will be absorbed by the gun's carriage and how the vertical recoil force will be absorbed by the ground.
The first method of traverse is to rely entirely on movement along a curved section of track or on a turntable with no provision to traverse the gun on its mount. The second is to traverse the rail car body on its trucks, known as a car-traversing mount. Generally this is limited to a few degrees of traverse to either side unless an elaborate foundation is built with a centre pivot and traversing rollers. The design of the foundation is the only limit to the amount of traverse allowed in this latter case. The third choice is to allow the separate gun mount to rotate with respect to the rail car body, known as a top-carriage traversing mount. This usually requires the gun to be mounted on a central pivot which, in turn, is mounted on the car body. With few exceptions these types of mounts require some number of outriggers, stabilisers, or earth anchors to keep them in place against the recoil forces and are generally more suitable for smaller guns. The American post-World War I assessment of railway artillery considered that the utility of even a small amount of traverse for fine adjustments was high enough that either of the two latter traversing methods is preferable to a fixed mount.
There are four primary methods to absorb the recoil force for railway guns: cradle recoil, top-carriage recoil, sliding recoil and rolling recoil.
Cradle recoil means that the gun recoils backward in its cradle, retarded and stopped by hydraulic buffers. It is returned to battery, or the firing position, by either helical springs or by air in a pneumatic recuperator cylinder that is compressed by the force of recoil. This is the most common method used for lighter railroad guns and for virtually all field artillery designed after the French introduced their Canon de 75 modèle 1897.