An X-ray detector and a heat dissipating method are provided. The heat dissipating method comprises providing an optical sensing panel over an internal support of the X-ray detector and providing a digital printed circuit board directly on a back cover, so that there is a gap between the digital printed circuit board and the optical sensing panel that is fixed by the internal support. The X-ray detector comprises an optical sensing panel bonded to the outer side of an internal support and a digital printed circuit board bonded to the inner side of a back cover, wherein there is a gap between the digital printed circuit board and the optical sensing panel that is fixed by the internal support.