Animal groups on the move can take different configurations. For example, groups of fish can either be 'shoals' or 'schools': shoals are simply aggregations of individuals; schools are shoals exhibiting polarized, synchronized motion. Here we demonstrate that polarization distributions of groups of zebrafish (Danio rerio) are bimodal, showing two distinct modes of collective motion corresponding to the definitions of shoaling and schooling. Other features of the group's motion also vary consistently between the two modes: zebrafish schools are faster and less dense than zebrafish shoals. Habituation to an environment can also alter the proportion of time zebrafish groups spend schooling or shoaling. Models of collective motion suggest that the degree and stability of group polarization increases with the group's density. Examining zebrafish groups of different sizes from 5 to 50, we show that larger groups are less polarized than smaller groups. Decreased fearfulness in larger groups may function similarly to habituation, causing them to spend more time shoaling than schooling, contrary to most models' predictions.