Ninety percent of all dinoflagellates are marine plankton. There are also many freshwater species, some of which have been found growing in snow! They may be photosynthetic or non-photosynthetic; about half the species fall into each category. The photosynthetic dinoflagellates are second only to diatoms as primary producers in coastal waters.
A number of photosynthetic dinoflagellates take up residence within other organisms as symbiotic partners. These zooxanthellae may be found in many marine invertebrates, including sponges, corals, jellyfish, and flatworms, as well as within protists, such as ciliates, foraminiferans, and colonial radiolarians. In each case, the host organism is able to swallow the dinoflagellate and incorporate it into its own tissues without harming it. The dinoflagellate then divides repeatedly to increase its numbers, and begins to manufacture carbohydrates which are provided to the host. The degree of interdependence varies greatly -- the sea anemone Anemonia can survive quite well without its zooxanthellae, while certain corals rely almost exclusively on the food from their symbionts, and build reefs much faster with the dinoflagellates present in their tissues.
Non-photosynthetic species of dinoflagellates feed on diatoms or other protists (including other dinoflagellates); the genus Noctiluca is large enough to eat fish eggs, and is able to swallow protists larger than itself. Some species will parasitize other organisms, such as zooplankton and other protists, filamentous algae, or fish.