Building panels provided with a mechanical locking system including a tongue, at first edge of a first building panel, cooperating with a tongue groove, at a second edge of an adjacent second building panel, for vertical locking of the building panels and a method for producing such building panels. The method includes the step of forming the tongue of material of the first edge. The insertion groove may have a sidewall at a third edge, which is adjacent the first edge, and may be open at a fourth edge, which is opposite the third edge.