The invention discloses a vertical-cavity surface-emitting laser capable of automatically focusing, and belongs to the field of semiconductor lasers. The vertical-cavity surface-emitting laser capable of automatically focusing comprises a P-type DBR (distributed Bragg reflective) layer, an active layer, an N-type DBR layer, a lining layer, a lower electrode wrapped on the P-type DBR layer, and an upper electrode laid on the lining layer. A part, covered on a light emitting window, of the upper electrode is shaped in a concentric ring or a structure with unequally spaced grid bars or crossed grid bars, the upper electrode with the above structure can be formed via the lift-off technology by one step, with the upper electrode, output laser light beams can be focused into a point light spot, or a linear light spot or a cross light spot without additionally adding a light beam shaping device, laser power intensity is greatly enhanced partly, and wide application requirements are met. The vertical-cavity surface-emitting laser capable of automatically focusing is simple in manufacturing technology, good in repeatability and easy to popularize.