Abstract: The invention discloses a built-in switch cap, including a cylinder body, one end of which is open for setting a tube, the other end is closed and is provided with pins and connected with a drive power. There is a micro-switch installed in the cap to control the ON/OFF of the drive power; a flexible button is provided to press the above micro switch, the press button is bulging from on the closed side of the cylinder body. The invention discloses a LED tube, which at least has one cap. The invention uses the micro switch installed in the lamp cap, pressing the button on the cap when touching the switch, the power source supplies power, increasing the safety of products. The cap also can directly replace the existing cap, with a strong commonality.