Tonsillectomy is a commonly performed surgical procedure worldwide; however, the possible long-term consequences have not been fully explored. The tonsils are secondary lymphoid tissue providing a defensive barrier against pathogens. There are few data in the literature on the relationship between prior tonsillectomy and the risk of irritable bowel syndrome (IBS). The aim of this study was to evaluate the risk of developing IBS in patients who underwent tonsillectomy using a nationwide longitudinal population-based cohort. We identified 1300 patients with tonsillectomy and 2600 matched controls from the Longitudinal Health Insurance Research Database of the National Health Insurance Research Database in Taiwan. Propensity score analysis was used for matching age, gender, comorbidities, medications, and index year at a ratio of 1:2. Multiple Cox regression analysis was used to estimate the adjusted hazard ratio of IBS. Furthermore, sensitivity tests and a stratified analysis were conducted. The incidence of IBS was 3 per 1,000 person-years in tonsillectomy patients, which was higher than the rate of 1.8 per 1,000 person-years found in non-tonsillectomy patients. After adjustment for patients’ age, gender, comorbidities, and medications, patients who underwent tonsillectomy had a 1.84-fold risk of developing IBS compared to those without tonsillectomy (adjusted hazard ratio [HR]:1.84; 95% CI, 1.09-3.09). Stratified analysis revealed that a higher adjusted HR of 3.79 (95% CI, 1.35-10.64) in patients ≥50 years old, and there was a marginally significantly higher adjusted HR of 1.98 (95% CI, 0.99-3.95) of developing IBS when the follow-up period was longer than 3 years. Tonsillectomy was associated with a higher risk of developing IBS. Physicians should provide appropriate monitoring of IBS in patients undergoing tonsillectomy.