We report mid-UV ( MUV ) observations taken with HST /WFC3 , Swift /UVOT and GALEX /NUV of the transitional millisecond pulsars XSS J12270 - 4859 and PSR J1023+0038 during their radio pulsar states . Both systems were detected in our images and showed MUV variability . At similar orbital phases , the MUV luminosities of both pulsars are comparable . This suggests that the emission processes involved in both objects are similar . We estimated limits on the mass ratio , companion ’ s temperature , inclination , and distance to XSS J12270 - 4859 by using a Markov Chain Monte Carlo algorithm to fit published folded optical light curves . Using the resulting parameters , we modeled MUV light curves in our HST filters . The resulting models failed to fit our MUV observations . Fixing the mass ratio of XSS J12270 - 4859 to the value reported in other studies , we obtained a distance of \sim 3.2 kpc . This is larger than the one derived from dispersion measure ( \sim 1.4 kpc ) . Assuming a uniform prior for the mass ratio , the distance is similar to that from radio measurements . However , it requires an undermassive companion ( \sim 0.01 M _ { \sun } ) . We conclude that a direct heating model alone can not fully explain the observations in optical and MUV . Therefore , an additional radiation source is needed . The source could be an intrabinary shock which contributes to the MUV flux and likely to the optical one as well . During the radio pulsar state , the MUV orbital variations of PSR J1023+0038 detected with GALEX , suggests the presence of an asymmetric intrabinary shock .