We compute the master integrals containing one massive propagator entering the two-loop electroweak form factor, i.e., the process ff->X, where ff is an on-shell massless fermion pair and X is a singlet particle under SU(2) L xU(1) Y , such as a virtual gluon or an hypothetical Z'. The method used is that of the differential equation in the evolution variable x=-s/m 2 , where s is the c.m. energy squared and m is the mass of the W or Z bosons (assumed to be degenerate). The 1/ε poles and the finite parts are computed exactly in terms of one-dimensional harmonic polylogarithms of the variable x, H(w;x), with ε=2-D/2 and D the space-time dimension. We present large-momentum expansions of the master integrals, i.e., expansions for s m 2 , which are relevant for the study of infrared properties of the Standard Model. We also derive small-momentum expansions of the master integrals, i.e., expansions in the region s m 2 , related to the threshold behaviour of the form factor (soft probe). Comparison with previous results in the literature is performed finding complete agreement.