We compute the exponential disc scalelength for 686 disc galaxies with spectroscopic redshifts out to redshift 5.8 based on Hubble Space Telescope archival data. We compare the results with our previous measurements based on 30 000 nearby galaxies from the Sloan Digital Sky Survey. Our results confirm the presence of a dominating exponential component in galaxies out to this redshift. At the highest redshifts, the disc scalelength for the brightest galaxies with absolute magnitude between −24 and −22 is up to a factor of 8 smaller compared to that in the local Universe. This observed scalelength decrease is significantly greater than the value predicted by a cosmological picture in which baryonic disc scalelength scales with the virial radius of the dark matter halo.