Pendrin (SLC26A4) is an anion exchanger that mediates bicarbonate (HCO) exchange for chloride (Cl) and is crucial for maintaining pH and salt homeostasis in the kidney, lung, and cochlea. Pendrin also exports iodide (I) in the thyroid gland. Pendrin mutations in humans lead to Pendred syndrome, causing hearing loss and goiter. Inhibition of pendrin is a validated approach for attenuating airway hyperresponsiveness in asthma and for treating hypertension. However, the mechanism of anion exchange and its inhibition by drugs remains poorly understood. We applied cryo-electron microscopy to determine structures of pendrin from Sus scrofa in the presence of either Cl, I, HCO or in the apo-state. The structures reveal two anion-binding sites in each protomer, and functional analyses show both sites are involved in anion exchange. The structures also show interactions between the Sulfate Transporter and Anti-Sigma factor antagonist (STAS) and transmembrane domains, and mutational studies suggest a regulatory role. We also determine the structure of pendrin in a complex with niflumic acid (NFA), which uncovers a mechanism of inhibition by competing with anion binding and impeding the structural changes necessary for anion exchange. These results reveal directions for understanding the mechanisms of anion selectivity and exchange and their regulations by the STAS domain. This work also establishes a foundation for analyzing the pathophysiology of mutations associated with Pendred syndrome.© 2024. The Author(s).