  The radio-quiet pulsar PSR J2021+4026 is mostly known because it is the only
rotation-powered pulsar that shows variability in its {\gamma}-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, i.e. 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 a simply blackbody. 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 of temperature T~1 MK and
colatitude extension {\theta}~20{\deg}. For the pulsar distance of 1.5 kpc,
this corresponds to a cap of R~5-6 km, 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), non-thermal 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
({\chi}=90{\deg} and {\xi}=20-25{\deg}) and consistent with that deduced from
{\gamma}-ray observations, provided that only one of the two hemispheres is
active. The evidence for an extended hot spot in PSR J2021+4026, found also in
other pulsars of similar age but not in older objects, suggests a possible age
dependence of the emitting size of thermal X-rays.
