W-S-N coatings deposited by reactive magnetron sputtering offer the possibility of ultra-low friction in unlubricated sliding. In this work, W-S-N coatings of different composition and structure have been deposited, characterised and evaluated with respect to the tribological performance and tribofilm formation. The composition was varied by changing the flow of N 2 into the deposition chamber, leading to N contents ranging from 0 to 47 at.%. W-S-N coatings deposited without substrate heating are amorphous, while substrate heating results in coatings containing nanocrystalline tungsten sulphide (WS x ) for low N contents, and nanocrystalline tungsten nitride (W y N) at a high N content. The coatings were tribologically tested against steel balls in four different atmospheres-dry N 2 , dry air, humid N 2 and humid air-to study the effects of atmospheric O 2 and H 2 O both separately and simultaneously. In dry N 2 , all coatings exhibited an excellent performance with very low friction (μ ≈ 0.02) and wear. Notably, this included the N-richest and hardest coating, containing nanocrystalline W y N and only 13 at.% of S. The friction and wear increased on changing the atmosphere, in the order of dry airhumid N 2 -humid air. In these three non-inert atmospheres, the friction and wear also increased with increasing N content of the coating. It is thus concluded that the presence of O 2 , the presence of H 2 O, and a high N content (i.e., low W and S contents) are three factors increasing the risk of high friction and wear, especially when occurring together. Raman spectroscopy mapping of the contact surfaces on the coatings and the balls showed that low friction and wear is connected to the presence of WS 2 tribofilms in the contact, and that the three previously mentioned factors affect the formation and function of this tribofilm.