This invention relates to a device and a method for forming elongated material.A device (824-864) according to the present invention for forming elongatedmaterial, is characterised in that the device comprises a track (821 ) for guidingthe material in the device, wherein the track is arranged to guide the movementof the material into a desired form when the material is fed into the device, andthe device comprises an opening (823, 824) along the entire length of the trackfor removing the elongated material from the device after the formation. Withthis invention it is possible to make knots and other structures of desired geometryeasily and efficiently.