The Centers for Disease Control and Prevention said its report was based on a survey of public schools in 34 states, comparing results from 2006 to 2008.
The study did not report the total number of schools that have changed. Instead, it looked at the proportion of schools in each state.
The CDC found that the median proportion of high schools and middle schools that sell the sugary or salty snacks dropped from 54 percent to 36 percent.
The share of schools that sell soda and artificial fruit drinks dropped from 62 percent to 37 percent.
The report marked a continued effort by health officials to combat childhood obesity.