A needleless connector includes a hollow connector, a spring, and a switch assembly. The inner perimeter of the hollow connector forms a first annular wall and a second annular wall. The spring is disposed in the hollow connector. The switch assembly has a stop member and a guide tube connected to the stop member, the stop member being pressed between the annular block and the spring, the guide tube being disposed in the hollow connector, the external perimeter of the stop member forming a first annular portion against the first annular wall and a second annular portion against the second annular wall, a groove being disposed between the first annular portion and the second annular portion of the stop member, the groove being connected to the guide tube. Thus, the integral structure stability and good closing performance are achieved such that the outside air cannot leak into the connector structure.