To reveal the role of Fe sublattice in the coercivity of R2Fe14B, we investigated the origin of perpendicular magnetocrystalline anisotropy (MCA) of Y2Fe14B using first-principles density-functional calculations. We found that the perpendicular MCA of Y2Fe14B arises predominantly from Fe sites with higher symmetry (16k1,2 and 8j1,2). On the other hand, the Fe(4c) sites show a significant contribution to the in-plane MCA. This can be attributed to the localized character of Fe(4c)-d orbitals in R2Fe14B. Furthermore, the MCA energy of Y2Fe14B increases as the number of valence electrons increases within the rigid band model, indicating that the partial substitution of Fe by Co can enhance the MCA energy of Y2Fe14B.