  The so-called NOON states are quantum optical resources known to be useful
especially for quantum lithography and metrology. At the same time, they are
known to be very sensitive to photon losses and rather hard to produce
experimentally. Concerning the former, here we present a scheme where NOON
states are the elementary resources for building quantum error correction codes
against photon losses, thus demonstrating that such resources can also be
useful to suppress the effect of loss. Our NOON-code is an exact code that can
be systematically extended from one-photon to higher-number losses. Its loss
scaling depending on the codeword photon number is the same as for some
existing, exact loss codes such as bosonic and quantum parity codes, but its
codeword mode number is intermediate between that of the other codes. Another
generalisation of the NOON-code is given for arbitrary logical qudits instead
of logical qubits. While, in general, the final codewords are always obtainable
from multi-mode NOON states through application of beam splitters, both
codewords for the one-photon-loss qubit NOON-code can be simply created from
single-photon states with beam splitters. We give various examples and also
discuss a potential application of our qudit code for quantum communication.
