The intensity of the \oiv~2s2 2p 2P-2s2p24P and \siv~3
s2 3p 2P- 3s 3p24 P intercombination lines around
1400~\AA~observed with the \textit{Interface Region Imaging Spectrograph}
(IRIS) provide a useful tool to diagnose the electron number density
(Ne) in the solar transition region plasma. We measure the electron
number density in a variety of solar features observed by IRIS, including an
active region (AR) loop, plage and brightening, and the ribbon of the
22-June-2015 M 6.5 class flare. By using the emissivity ratios of \oiv\ and
\siv\ lines, we find that our observations are consistent with the emitting
plasma being near isothermal (logT[K] ≈ 5) and iso-density
(Ne≈~1010.6 cm−3) in the AR loop. Moreover, high
electron number densities (Ne≈~1013 cm−3) are
obtained during the impulsive phase of the flare by using the \siv\ line ratio.
We note that the \siv\ lines provide a higher range of density sensitivity than
the \oiv\ lines. Finally, we investigate the effects of high densities
(Ne≳ 1011 cm−3) on the ionization balance. In
particular, the fractional ion abundances are found to be shifted towards lower
temperatures for high densities compared to the low density case. We also
explored the effects of a non-Maxwellian electron distribution on our
diagnostic method.VP acknowledges support from the Isaac Newton Studentship, the Cambridge Trust, the IRIS team at Harvard-Smithsonian Centre for Astrophysics and the RS Newton Alumni Programme. GDZ and HEM acknowledge support from the STFC and the RS Newton Alumni Programme. JD acknowledges support from the RS Newton Alumni Programme. JD also acknowledges support from the Grant No. P209/12/1652 of the Grant Agency of the Czech Republic. AG acknowledges the in house research support provided by the Science and Technology Facilities Council. KR is supported by contract 8100002705 from Lockheed-Martin to SAO. IRIS is a NASA small explorer mission developed and operated by LMSAL with mission operations executed at NASA Ames Research Center and major contributions to downlink communications funded by the Norwegian Space Center (NSC, Norway) through an ESA PRODEX contract. AIA data are courtesy of NASA/SDO and the respective science teams. CHIANTI is a collaborative project involving researchers at the universities of Cambridge (UK), George Mason and Michigan (USA). ADAS is a project managed at the University of Strathclyde (UK) and funded through memberships universities and astrophysics and fusion laboratories in Europe and worldwide.This is the author accepted manuscript. It is currently under an indefinite embargo pending publication by EDP Sciences