A novel electron cyclotron resonance x-ray source is constructed based on the ECR technique. In this paper, the possibility of using the ECR x-ray source for producing UV rays by optimizing the plasma parameters is explored. X-ray and UV emissions from the ECR x-ray source are carried out for argon, nitrogen, and CO(2) plasma. The x-ray spectral and dose measurements are carried with NaI(Tl) based spectrometer and dosimeter, respectively. For UV measurement, a quartz window arrangement is made at the exit port and the UV intensity is measured at 5 cm from the quartz plate using UV meter. The x-ray and UV emissions are carried out for different microwave power levels and gas pressures. The x-ray emission is observed in the pressure range < or =10(-5) Torr, whereas the UV emission is found to be negligible for the gas pressures <10(-5) Torr and it starts increasing in the pressure range between 10(-5) and 10(-3) Torr. At high-pressure range, collision frequency of electron-atom is large which leads to the higher UV flux. At low pressure, the electron-atom collision frequency is low and hence the electrons reach high energy and by hitting the cavity wall produces higher x-ray flux. By choosing proper experimental conditions and plasma gas species, the same source can be used as either an x-ray source or an UV source.