Sterols are cyclic isoprenoid lipids present in all eukaryotes. These compounds have been used to determine the composition of algal communities in marine and lake environments, and because of their preservation potential have been used to reconstruct the evolution of eukaryotes. In the last years, there have been major advances in understanding the sterol biosynthetic pathways and the enzymes involved. Here, we have explored the diversity and phylogenetic distribution of the gene coding the cycloartenol synthase (CS), a key enzyme of the phytosterol biosynthetic pathway. We propose a gene-based approach that can be used to assess the sterol-forming potential of algal groups. CS coding gene was annotated in genomes of microalgae using protein homology with previously annotated CS sequences. Primers for the detection of CS gene sequences of diatoms, one of the most dominant groups of microalgae, were designed and evaluated in cultures and environmental samples. A comparison of the phylogeny of the recovered CS sequences in combination with sequence data of the gene rbcL coding for the large subunit of the ribulose-1,5-bisphosphate carboxylase/oxygenase (Rubisco) demonstrates the potential of the CS gene as phylogenetic marker, as well as an indicator for the identity of sterol-producing organisms in the environment.