GaN-based p–i–n X-ray detectors have been fabricated. We observed using SEM that the surface of a GaN sample has a large number of hexagonal defects. The SEM results show that GaN itself contains numerous screw dislocations that will be the flow channel of leakage current, which in turn increased the reverse-bias leakage current of detectors. We have observed a two-step increase in X-ray photocurrent, which is caused by two different detection mechanisms: photovoltaic and photoconductive, and the total photocurrent (Jp) to dark current (Jd) ratio is about 27.7 times and the net photocurrent is about 2.52 µA at 110 V reverse bias. As the X-ray accelerating voltage increases, the photocurrent has a sublinear trend.