Using tools from quantum information theory, we present a general theory of indistinguishability of identical bosons in experiments consisting of passive linear optics followed by particle number detection. Our results do neither rely on additional assumptions on the input state of the interferometer, such as, for instance, a fixed mode occupation, nor on any assumption on the degrees of freedom that potentially make the particles distinguishable.