Acid taste, evoked mainly by protons (H+), is a core taste modality for many organisms. The hedonic valence of acid taste is bidirectional: animals prefer slightly but avoid highly acidic foods. However, how animals discriminate low from high acidity remains poorly understood. To explore the taste perception of acid, we use the fruit fly as a model organism. We find that flies employ two competing taste sensory pathways to detect low and high acidity, and the relative degree of activation of each determines either attractive or aversive responses. Moreover, we establish one member of the fly Otopetrin family, Otopetrin-like a (OtopLa), as a proton channel dedicated to the gustatory detection of acid. OtopLa defines a unique subset of gustatory receptor neurons and is selectively required for attractive rather than aversive taste responses. Loss of otopla causes flies to reject normally attractive low-acid foods. Therefore, the identification of OtopLa as a low-acid sensor firmly supports our competition model of acid taste sensation. Altogether, we have discovered a binary acid-sensing mechanism that may be evolutionarily conserved between insects and mammals.