  Aims: The two stable isotopes of nitrogen, 14N and 15N, exhibit a range of
abundance ratios both inside and outside the solar system. The elemental ratio
in the solar neighborhood is 440. Recent ALMA observations showed HCN/HC15N
ratios from 83 to 156 in six T Tauri and Herbig disks and a CN/C15 N ratio of
323 +/- 30 in one T Tauri star. We aim to determine the dominant mechanism
responsible for these enhancements of 15N: low-temperature exchange reactions
or isotope-selective photodissociation of N2.
  Methods: Using the thermochemical code DALI, we model the nitrogen isotope
chemistry in circumstellar disks with a 2D axisymmetric geometry. Our chemical
network is the first to include both fractionation mechanisms for nitrogen. The
model produces abundance profiles and isotope ratios for several key N-bearing
species. We study how these isotope ratios depend on various disk parameters.
  Results: The formation of CN and HCN is closely coupled to the vibrational
excitation of H2 in the UV-irradiated surface layers of the disk. Isotope
fractionation is completely dominated by isotope-selective photodissociation of
N2. The column density ratio of HCN over HC15N in the disk's inner 100 au does
not depend strongly on the disk mass, the flaring angle or the stellar
spectrum, but it is sensitive to the grain size distribution. For larger
grains, self-shielding of N2 becomes more important relative to dust
extinction, leading to stronger isotope fractionation. Between disk radii of
~50 and 200 au, the models predict HCN/HC15N and CN/C15N abundance ratios
consistent with observations of disks and comets. The HCN/HC15N and CN/C15N
column density ratios in the models are a factor of 2-3 higher than those
inferred from the ALMA observations.
