The carboxysome is a complex, proteinaceous organelle that plays essential roles in carbon assimilation in cyanobacteria and chemoautotrophs. It comprises hundreds of protein homologs that self-assemble in space to form an icosahedral structure. Despite its significance in enhancing CO2 fixation and potentials in bioengineering applications, the formation of carboxysomes and their structural composition, stoichiometry, and adaptation to cope with environmental changes remain unclear. Here we use live-cell single-molecule fluorescence microscopy, coupled with confocal and electron microscopy, to decipher the absolute protein stoichiometry and organizational variability of single β-carboxysomes in the model cyanobacterium Synechococcus elongatus PCC7942. We determine the physiological abundance of individual building blocks within the icosahedral carboxysome. We further find that the protein stoichiometry, diameter, localization, and mobility patterns of carboxysomes in cells depend sensitively on the microenvironmental levels of CO2 and light intensity during cell growth, revealing cellular strategies of dynamic regulation. These findings, also applicable to other bacterial microcompartments and macromolecular self-assembling systems, advance our knowledge of the principles that mediate carboxysome formation and structural modulation. It will empower rational design and construction of entire functional metabolic factories in heterologous organisms, for example crop plants, to boost photosynthesis and agricultural productivity.