A folding mechanism for collapsible agricultural machines, wherein the agricultural machines have a first part and a second part that are movable in relation to each other about a pivot, and where the folding mechanism includes at least one cylinder, where the cylinder is fastened to the first part of the agricultural machine, and where the cylinder piston rod is connected to the second part of the agricultural machine, and where the cylinder piston rod has a cross-pin which is inserted into elongated cutouts with a first end and a second end, where the elongated cutouts are at either side of the piston rod and in the second part of the agricultural machine, and where the folding mechanism further includes a locking device between the cross-pin and funnel-shaped locking means on the first part of the agricultural machine, whereby a collapsible mechanism for agricultural machines is achieved, where the free ends of the boom arm can be collapsed and thereby minimise the width of the agricultural machine as well as a collapsible mechanism which is extremely reliable, simple and with minimal maintenance costs as there are very few movable parts.