Which properties of a molecule define its odor? This is a basic yet unanswered question regarding the olfactory system. The olfactory system of Drosophila has a repertoire of approximately 60 odorant receptors. Molecules bind to odorant receptors with different affinities and activate them with different efficacies, thus providing a combinatorial code that identifies odorants. We hypothesized that the binding affinity of an odorant-receptor pair is affected by their relative sizes. The maximum affinity can be attained when the molecular volume of an odorant matches the volume of the binding pocket. The affinity drops to zero when the sizes are too different, thus obscuring the effects of other molecular properties. We developed a mathematical formulation of this hypothesis and verified it using Drosophila data. We also predicted the volume and structural flexibility of the binding site of each odorant receptor; these features significantly differ between odorant receptors. The differences in the volumes and structural flexibilities of different odorant receptor binding sites may explain the difference in the scents of similar molecules with different sizes.