The C I135.58nm line is located in the wavelength range of NASA's Interface Region Imaging Spectrograph (IRIS) small explorer mission. We study the formation and diagnostic potential of this line by means of non localthermodynamic-equilibrium modeling, employing both 1D and 3D radiation-magnetohydrodynamic models. The C I/C II ionization balance is strongly influenced by photoionization by Lyα emission. The emission in the C I135.58nm line is dominated by a recombination cascade and the line forming region is optically thick. The Doppler shift of the line correlates strongly with the vertical velocity in its line forming region, which is typically located at 1.5 Mm height. With IRIS, the C I135.58nm line is usually observed together with the O I135.56nm line, and from the Doppler shift of both lines, we obtain the velocity difference between the line forming regions of the two lines. From the ratio of the C I/O I line core intensity, we can determine the distance between the C I and the O I forming layers. Combined with the velocity difference, the velocity gradient at mid-chromospheric heights can be derived. The C I/O I total intensity line ratio is correlated with the inverse of the electron density in the midchromosphere. We conclude that the C I135.58nm line is an excellent probe of the middle chromosphere by itself, and together with the O I135.56nm line the two lines provide even more information, which complements other powerful chromospheric diagnostics of IRIS such as the Mg II h and k lines and the C II lines around 133.5nm.