An LED tube lamp comprises a tube, an LED light strip inside the tube, a plurality of LED light sources on the LED light strip, a power supply, and a first and a second end caps. The power supply comprises a circuit board, a plurality of electronic components and a heat-dissipating element. The plurality of electronic components and the heat-dissipating element are on the circuit board. The first end cap and the second end cap are respectively attached at two ends of the tube. The first end cap comprises a lateral wall and an end wall having an opening. The lateral wall is substantially coaxial with the tube and connected to the tube. The end wall is substantially perpendicular to an axial direction of the lateral wall and connected to an end of the lateral wall away from the tube. At least some of the plurality of electronic components and the heat-dissipating element are disposed inside the first end cap. The heat-dissipating element is closer to the opening on the end wall of the first end cap than the electronic components in the end cap are.