Not all species of unicorn fish sport the iconic forehead horns from which their subfamily of the Naso genus takes its name. Only eight of 18 species develop the bony spikes, which affect their ability to feed and can even determine their diet. The varying feeding habits of unicorn fish consequently hinge on whether or not they have horns; in either case, the different species of unicorn fish share certain adaptations that make eating easier.
Most species of unicornfish feed primarily on algae, which they find growing on rocks, coral and other flat surfaces -- they may even consume the algae growing on a turtle's shell. Because they gather food by scraping it off surfaces like these, they have serrated teeth to allow them to more efficiently strip away food. Unicorn fish live primarily in shallow waters, where they can easily access the algae growing on floor-level surfaces, and they feed in groups to protect themselves and to protect their food from other algae-eating creatures.
Unicorn fish anatomy helps determine what to feed. For example, because these fish gather and eat algae by scraping it off rocks and other surfaces, their eyes are typically high on their heads and their mouths are positioned low. This enables them to scrape with their teeth without abrading their eyes on the surfaces they are scraping. The species that develop horns, on the other hand, have significantly impeded scraping capabilities, and these species develop alternative diets that don't require them to rely on the same algae-scraping techniques. For example, they feed more on zooplankton and algae on surfaces they can access in spite of their horns.
Unicorn fish both with and without horns feed on zooplankton -- in fact, 12 species eat zooplankton almost exclusively. Zooplankton are the relatively small, drifting creatures such as krill that are generally eaten en masse. Unicorn fish generally focus on larger types, like larvaceans and chaetognaths. Most horned unicorn fish feed on zooplankton to some extent, because their algae options are limited by their forehead protrusions -- their horns prevent them from scraping algae that is closely formed to rocks.
As schools of unicorn fish patrol shallow ocean waters looking for zooplankton and algae, they may feed opportunistically on the waste of other creatures. Unicorn fish strategically swim underneath and behind other schools of fish so they can consume their feces. By following predatory fish only and eating their waste, they consume some nutrients left over in the digested, eliminated prey.