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