BackgroundRemoval of tonsils and adenoids is among the most common surgical procedures worldwide. Evidence of increased risk of cancer following such surgery is, however, inconclusive.MethodsWe conducted a population-based, sibling-controlled cohort study of 4,953,583 individuals in Sweden with a follow-up during 1980–2016. History of tonsillectomy, adenotonsillectomy, and adenoidectomy was identified from the Swedish Patient Register whereas incident cases of cancer during follow-up were identified from the Swedish Cancer Register. We used Cox models to calculate hazard ratios (HR) with 95% confidence intervals (CI) of cancer in both a population and a sibling comparison. The sibling comparison was used to assess the potential impact of familial confounding, due to shared genetic or non-genetic factors within a family.ResultsWe found a modestly increased risk for any cancer following tonsillectomy, adenoidectomy, or adenotonsillectomy in both the population (HR 1.10; 95%CI 1.07–1.12) and sibling (HR 1.15; 95%CI 1.10–1.20) comparisons. The association did not differ greatly by type of surgery, age at surgery, or potential indication for surgery, and persisted more than two decades after surgery. An excess risk was consistently observed for cancer of the breast, prostate, thyroid, and for lymphoma in both population and sibling comparisons. A positive association was observed for pancreatic cancer, kidney cancer, and leukemia in the population comparison whereas a positive association was observed for esophageal cancer in the sibling comparison.ConclusionsSurgical removal of tonsils and adenoids is associated with a modestly increased risk of cancer during the decades following the surgery. The association is unlikely attributed to confounding due to shared genetic or non-genetic factors with a family.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12916-023-02902-x.