Food insecurity (FI) may predispose individuals to suboptimal nutrition, leading to chronic disease and poor health outcomes. We sought to assess the impact of county-level FI on postoperative outcomes among patients undergoing resection of hepatopancreaticobiliary (HPB) cancer. Patients who were diagnosed with HPB cancer between 2010 and 2015 were identified from the Surveillance, Epidemiology, and End Results (SEER)-Medicare database. Data on annual county-level FI were obtained from the Feeding America: Mapping the Meal Gap report and were categorized into tertiles. Textbook outcome was defined as no extended length of stay, perioperative complications, 90-day readmission, and 90-day mortality. Multiple logistic regression and Cox regression models were used to assess outcomes and survival relative to FI. Among 49,882 patients (hepatocellular: n = 11,937, 23.9%; intrahepatic cholangiocarcinoma: n = 2111, 4.2%; extrahepatic cholangiocarcinoma: n = 4047, 8.1%; gallbladder: n = 2853, 5.7%; pancreatic: n = 28,934, 58.0%), 6702 (13.4%) patients underwent a surgical resection. Median age was 75 years (interquartile range 69-82), and most patients were male (n = 25,767, 51.7%) and self-identified as White (n = 36,381, 72.9%). Overall, 5291 (10.6%) and 39,664 (79.5%) individuals resided in low or moderate FI counties, respectively, while 4927 (9.8%) patients resided in high FI counties. Achievement of textbook outcome (TO) was 56.3% (n = 6702). After adjusting for competing risk factors, patients residing in high FI counties had lower odds to achieve a TO versus individuals living in low FI counties (odds ratio 0.69, 95% confidence interval [CI] 0.54-0.88, p = 0.003). In addition, patients residing in moderate and high FI counties had a greater risk of mortality at 1- (referent, low, moderate: hazard ratio [HR] 1.09, 95% CI 1.05-1.14; high: HR 1.14, 95% CI 1.08-1.21), 3- (referent, low, moderate: HR 1.09, 95% CI 1.05-1.14; high: HR 1.14, 95% CI 1.08-1.21), and 5- (referent, low, moderate: HR 1.05, 95% CI 1.01-1.09; high: HR 1.07, 95% CI 1.02-1.13) years versus individuals from low FI counties. FI was associated with adverse perioperative outcomes and long-term survival following resection of an HPB malignancy. Interventions directed towards mitigating nutritional inequities are needed to improve outcomes among vulnerable HPB populations.