Odor information is encoded in the activity of a population of glomeruli in the primary olfactory center. However, how this information is decoded in the brain remains elusive. Here, we address this question in Drosophila by combining neuronal imaging and tracking of innate behavioral responses. We find that the behavior is accurately predicted by a model summing normalized glomerular responses, in which each glomerulus contributes a specific, small amount to odor preference. This model is further supported by targeted manipulations of glomerular input, which biased the behavior. Additionally, we observe that relative odor preference changes and can even switch depending on the context, an effect correctly predicted by our normalization model. Our results indicate that olfactory information is decoded from the pooled activity of a glomerular repertoire and demonstrate the ability of the olfactory system to adapt to the statistics of its environment.