The elemental composition of primary producers reflects the availability of light, carbon and nutrients in their environment. According to the carbon-nutrient balance hypothesis, this has implications for the production of secondary metabolites. To test this hypothesis, we investigated a family of toxins, known as microcystins, produced by harmful cyanobacteria. The strain Microcystis aeruginosa HUB 5-2-4, which produces several microcystin variants of different N:C stoichiometry, was cultured in chemostats supplied with various combinations of nitrate and CO2. Excess supply of both nitrogen and carbon yielded high cellular N:C ratios accompanied by high cellular contents of total microcystin and the nitrogen-rich variant microcystin-RR. Comparable patterns were found in Microcystis-dominated lakes, where the relative microcystin-RR content increased with the seston N:C ratio. In total, our results are largely consistent with the carbon-nutrient balance hypothesis, and warn that a combination of rising CO2 and nitrogen enrichment will affect the microcystin composition of harmful cyanobacteria.