The radio-quiet pulsar PSR J2021+4026 is mostly known because it is the only rotation-powered pulsar that shows variability in its γ-ray emission. Using XMM-Newton archival data, we first confirmed that its flux is steady in the X-ray band, and then we showed that both the spectral and timing X-ray properties, that is to say the narrow pulse profile, the high pulsed fraction of 80–90%, and its dependence on the energy, can be better reproduced using a magnetized atmosphere model instead of simply a blackbody model. With a maximum likelihood analysis in the energy-phase space, we inferred that the pulsar has, in correspondence of one magnetic pole, a hot spot with a temperature of T ∼ 1 MK and colatitude extension of θ ∼ 20°. For the pulsar distance of 1.5 kpc, this corresponds to a cap of R ∼ 5 − 6 km, which is greater than the standard dimension of the dipolar polar caps. The large pulsed fraction further argues against emission from the entire star surface, as it would be expected in the case of secular cooling. An unpulsed (≲40% pulsed fraction), nonthermal component, probably originating in a wind nebula, is also detected. The pulsar geometry derived with our spectral fits in the X-ray is relatively well constrained (χ = 90° and ξ = 20°–25°) and consistent with what is deduced from γ-ray observations, provided that only one of the two hemispheres is active. The evidence for an extended hot spot in PSR J2021+4026, which was also found in other pulsars of a similar age but not in older objects, suggests a possible age dependence of the emitting size of thermal X-rays.