The impact of temperature and light on rice quality has high research interest, but the mechanism remains unclear. Herein, six rice cultivars were planted in karst regions of Xingyi (XY, 1300 m above sea level, asl), Guiding (GD, 1100 m asl), and Huangping (HP, 684 m asl) in China. Starch molecular structures were investigated to reveal the influences of ecological conditions during grain-filling stage on rice quality. Results revealed that the apparent amylose contents (AACs) increased by 11.40% to 27.49%, but the pasting viscosity and gelatinization temperature decreased with the increase in altitude. Rice grown in HP exhibited the highest gelatinization temperatures (68.41-75.22 °C), higher relative crystallinity, more proportions of long amylopectin chains (DP ≥ 37) and amylose with short chains (DP 100-1000). Environmental temperatures were positively correlated with peak viscosity, relative crystallinity, and proportions of long fb