Context. The increased sensitivity and high spectral resolution of millimeter telescopes allow the detection of an increasing number of isotopically substituted molecules in the interstellar medium. The 14 N/ 15 N ratio is difficult to measure directly for molecules containing carbon. Aims. Using a time-dependent gas-phase chemical model, we check the underlying hypothesis that the 13 C/ 12 C ratio of nitriles and isonitriles is equal to the elemental value. Methods. We built a chemical network that contains D, 13 C, and 15 N molecular species after a careful check of the possible fractionation reactions at work in the gas phase. Results. Model results obtained for two different physical conditions that correspond to a moderately dense cloud in an early evolutionary stage and a dense, depleted prestellar core tend to show that ammonia and its singly deuterated form are somewhat enriched in 15 N, which agrees with observations. The 14 N/ 15 N ratio in N 2 H + is found to be close to the elemental value, in contrast to previous models that obtain a significant enrichment, because we found that the fractionation reaction between 15 N and N 2 H + has a barrier in the entrance channel. The high values of the N 2 H + / 15 NNH + and N 2 H + /N 15 NH + ratios derived in L1544 cannot be reproduced in our model. Finally, we find that nitriles and isonitriles are in fact significantly depleted in 13 C, thereby challenging previous interpretations of observed C 15 N, HC 15 N, and H 15 NC abundances from 13 C containing isotopologues.