To facilitate the demounting of a chain (3) from a chainsaw, the saw has a lever arm preferably in the form of hinged cover (11) arranged to displace the sprocket (15) towards the guide bar (2) the other upon opening of the cover (11). Upon closing the cover (11), the sprocket (15) is displaced in the opposite direction to pre-tension the chain (3). The sprocket (15, 115) may be driven over a gear transmission (27, 127), which when the chain (3, 103) is running at ordinary cutting speed uses resulting forces to automatically tension the chain (3, 103) by displacing the sprocket (15, 115) away from the guide bar (2, 102). A ratchet mechanism (34) may be provided to maintain the chain tension upon reduction of the chain speed by preventing the sprocket (15) from moving toward the guide bar (2).Alternatively, a mechanism for automatically tensioning the chain (3, 238) of a chainsaw includes a driving inner sprocket (76, 201), and an outer ring member (77, 204) surrounding the inner sprocket (76, 201). A spring (64, 87, 228) may be provided for assisting the ratchet mechanism or as a substitute therefore.