ABSTRACT Based on galaxies in the Sloan Digital Sky Survey Data Release 7 and dark matter haloes in the dark matter only, cosmological, and constrained ELUCID simulation, we investigate the relation between the observed radii of central galaxies with stellar mass $\gtrsim\!{10}^{8} \, h^{-2}\, {\rm M}_\odot$ and the virial radii of their host dark matter haloes with virial mass $\gtrsim\!{10}^{10.5} \, h^{-1}\, {\rm M}_\odot$, and the dependence of galaxy–halo size relation on the halo spin and concentration. Galaxies in observation are matched to dark matter (sub)haloes in the ELUCID simulation using a novel neighbourhood subhalo abundance matching method. For galaxy two-dimensional (2D) half-light radii R50, we find that early- and late-type galaxies have the same power-law index 0.55 with $R_{50} \propto R_{\rm vir}^{0.55}$, although early-type galaxies have smaller 2D half-light radii than late-type galaxies at fixed halo virial radii. When converting the 2D half-light radii R50 to 3D half-mass radii r1/2, both early- and late-type galaxies display similar galaxy–halo size relations with $\log r_{1/2} = 0.55 \log (R_{\rm vir}/210 \, h^{-1}\, {\rm kpc}) + 0.39$. We find that the galaxy–halo size ratio r1/2/Rvir decreases with increasing halo mass. At fixed halo mass, there is no significant dependence of galaxy–halo size ratio on the halo spin or concentration.