A method and a device are provided for pressure welding, in particular for the friction welding or magnetic arc welding of workpieces (2, 3). The actual length of one or both workpieces (2, 3) and a potential length deviation (DELTA 1) from a target value is measured. If a length deviation exists, the target value of at least one parameter, in particular of the friction length, friction duration, arcing time or forge force is modified. A correction factor C, by which the length deviation (DELTA 1) is multiplied, is determined for this modification. The pressure welding device (1) includes a corresponding measuring unit (12) for determining workpiece lengths and length deviations. The controller (13) comprises an arithmetic unit (14) for setting and modifying target values, taking into account the correction factor C.