We present a 40ks Chandra observation of the IRAS20126+4104 core region. In the inner 6′′ two X-ray sources were detected, which are coincident with the radio jet source I20S and the variable radio source I20Var. No X-ray emission was detected from the nearby massive protostar I20N. The spectra of both detected sources are hard and highly absorbed, with no emission below 3keV. For I20S, the measured 0.5−8keV count rate was 4.3ctsks−1. The X-ray spectrum was fit with an absorbed 1T APEC model with an energy of kT=10keV and an absorbing column of NH=1.2×1023cm−2. An unabsorbed X-ray luminosity of about 1.4×1032ergs−1 was estimated. The spectrum shows broad line emission between 6.4 and 6.7\, keV, indicative of emission from both neutral and highly ionized iron. The X-ray lightcurve indicates that I20S is marginally variable; however, no flare emission was observed. The variable radio source I20Var was detected with a count rate of 0.9ctsks−1 but there was no evidence of X-ray variability. The best fit spectral model is a 1T APEC model with an absorbing hydrogen column of NH=1.1×1023cm−2 and a plasma energy of kT = 6.0keV. The unabsorbed X-ray luminosity is about 3×1031ergs−1.