A pattern forming method comprises the steps that a film layer and an etching barrier layer placed on the film layer are formed on a substrate; a plurality of first patterns, which are arrayed in parallel at equal intervals, of a first line are formed on the etching barrier layer; a second line is formed on the side wall of the first line, wherein the line width of the second line is equal to the line width of the first line, and the second line is made of materials different from that of the first line; a third line is formed in the side wall of the second line, and the line width of the third line is equal to the line width of the first line; a fourth line is arranged on the side wall of the third line in an epitaxial growth mode, the line width of the fourth line is equal to the line width of the first line, and the fourth line is made of materials different from that of the third line; the parts, which are not covered with the first line, the second line, the third line and the fourth line, of the etching barrier layer are removed to expose the film layer; a fifth line is arranged on the film layer in an epitaxial growth mode, and the fifth line is made of materials different from that of the fourth line; the second line and the fourth line are removed, and the patterns which are finally formed comprise the first line, the second line and the fifth line. The patterns have even array density and a good line width, and therefore a semiconductor device formed by the patterns is good in performance.