The coercivity mechanism of Nd-Fe-B thin film samples with and without Nd deposition was investigated by simultaneous chemical and magnetic imaging by means of X-ray magnetic circular dichroism-photoemission electron microscopy. The two Nd-Fe-B thin film samples exhibited almost the same surface morphology and magnetic domain patterns, but their coercive fields were quite different, being 0.98 T for the sample with Nd deposition and 0.55 T for sample without Nd deposition. The chemical distribution of Nd revealed that Nd aggregates with the average size of 130 nm exist, and the density in the Nd-deposited sample is much higher than that in the not deposited one. A comparison of the magnetic and chemical contrast images implied that the Nd aggregates act as domain wall pinning sites, indicating that the large coercivity difference in the Nd-Fe-B thin films would be attributable to the different density of wall pinning sites.