Airborne bacteria are an important component of atmospheric fine particulate matter (PM2.5), yet the interactions between microbial communities and organic compounds remain poorly characterized. This study investigated the impact of alkane chain length on bacterial dynamics in outdoor PM2.5 using correlation analysis, generalized additive models, and network-based approaches. Among individual alkane species, C30 (n-triacontane) showed a consistent positive association with bacterial concentration in both simple and partial correlation analyses, whereas C20 (n-eicosane) and C24 (n-tetracosane) exhibited significant negative associations only after controlling for collinearity among alkanes. Grouped alkane classes (C20–C24, C25–C29, C30– C35) did not show statistically significant nonlinear effects on bacterial concentration in models using the full dataset. However, temperature demonstrated a strong nonlinear effect and acted as a modifier of alkane-bacteria relationships. Stratified generalized additive models revealed that under high-temperature conditions (≥ 14oC), all three alkane groups showed significant and localized nonlinear associations with bacterial concentration, with the strongest positive response observed for C30–C35 (p = 0.0011). Network analysis indicated that mid-chain alkanes (C20–C25) were positively linked to metabolically versatile genera such as Pseudomonas, Caldalkalibacillus, Pseudarthrobacter, Pigmentiphaga, and Janthinobacterium, whereas long-chain alkanes (C26–C35) were negatively associated with genera including Methylosinus, Pelomonas, and Pedomicrobium. These results suggest that alkane chain length acts as an ecological filter structuring bacterial communities present in PM2.5 and that hightemperature conditions (≥ 14oC) enhance these interactions by altering alkane phase behavior and particle stability. Understanding these coupled chemical and biological processes is therefore critical for anticipating future changes in air quality and emerging health risks.