Down Syndrome cell adhesion molecule (Dscam) genes encode neuronal cell recognition proteins of the immunoglobulin superfamily. In Drosophila, Dscam1 generates 19,008 different ectodomains by alternative splicing of three exon clusters, each encoding half or a complete variable immunoglobulin domain. Identical isoforms bind to each other, but rarely to isoforms differing at any one of the variable immunoglobulin domains. Binding between isoforms on opposing membranes promotes repulsion. Isoform diversity provides the molecular basis for neurite self-avoidance. Self-avoidance refers to the tendency of branches from the same neuron (self-branches) to selectively avoid one another. To ensure that repulsion is restricted to self-branches, different neurons express different sets of isoforms in a biased stochastic fashion. Genetic studies demonstrated that Dscam1 diversity has a profound role in wiring the fly brain. Here we show how many isoforms are required to provide an identification system that prevents non-self branches from inappropriately recognizing each other. Using homologous recombination, we generated mutant animals encoding 12, 24, 576 and 1,152 potential isoforms. Mutant animals with deletions encoding 4,752 and 14,256 isoforms were also analysed. Branching phenotypes were assessed in three classes of neurons. Branching patterns improved as the potential number of isoforms increased, and this was independent of the identity of the isoforms. Although branching defects in animals with 1,152 potential isoforms remained substantial, animals with 4,752 isoforms were indistinguishable from wild-type controls. Mathematical modelling studies were consistent with the experimental results that thousands of isoforms are necessary to ensure acquisition of unique Dscam1 identities in many neurons. We conclude that thousands of isoforms are essential to provide neurons with a robust discrimination mechanism to distinguish between self and non-self during self-avoidance.