Floor panels (1, 1′) are shown, which are provided with a mechanical locking system including a flexible tongue (10) in a displacement groove (11). The flexible tongue (10) may be formed from the core material (5) of the floor panels and inserted during production into the displacement groove (11). The locking system may be locked with vertical folding.