The invention relates to a welding machine, particularly to an automatic straight pipe flange welding machine which is suitable for both plug-in type flange assembly type welding and butt-joint type flange assembly welding. The automatic straight pipe flange welding machine comprises a base, wherein base guide rails are arranged on the base, a trolley base is arranged on the base guide rails, a control system is arranged on one side of the trolley base, a welding torch machine is arranged on the trolley base and comprises a longitudinal adjusting mechanism, a lateral adjusting mechanism, an inner welding torch mechanism, an outer welding torch mechanism and a roller adjusting mechanism, wherein the inner welding torch mechanism consists of an inner welding torch upright post device and aninner welding torch device, and the outer welding torch mechanism includes an outer welding torch upright post device and an outer welding torch device. The automatic straight pipe flange welding machine has high automatic degree, improves welding efficiency, reduces grinding time and waste of welding materials, guarantees welding quality, and attractive formation of weld seams, is convenient to operate, saves labor, and lightens labor intensity.