The form factor, representing the statistical characteristics of a bunch's longitudinal distribution, is one of the most essential properties of a pre-bunched electron beam and is used for many types of frontier accelerator applications. We demonstrated the measurement of a pre-bunched beam's longitudinal form factor component based on coherent radiation from a widely tunable-gap undulator. The radiation energy from bunches with different longitudinal properties was measured as a function of undulator gap. The root-mean-square length of a 60 pC ultrashort quasi-Gaussian bunch generated by linac and chicane compression ranged from 75 fs to 240 fs, as obtained by fitting the radiation energy curve. Furthermore, the form factor component of the bunch train based on nonlinear longitudinal space charge oscillation was measured, and a higher-order harmonic component was observed with the proposed method than with the widely used coherent transition radiation method. The proposed method may satisfy the requirements of sub-fs bunch length measurement with proper undulator design.