The pan-immune-inflammation value (PIV) is a bioindicator that provides a broader evaluation of systemic immune and inflammatory responses. However, limited research exists regarding its ability to predict chronic kidney disease (CKD) and all-cause mortality, which this study intends to investigate. This analysis drew on data from 1999-2018 National Health and Nutrition Examination Survey (NHANES). Logistic regression analyzed the association of PIV with CKD prevalence, while Cox proportional hazards regression and Kaplan-Meier curves assessed its link to all-cause mortality in CKD patients. To explore nonlinear relationships, we applied restrictive cubic splines (RCS) and two-piece regression models. Subgroup and interaction analyses assessed how covariates influence these associations. This study included 40,735 participants, all aged 20 or above (mean age 49.73 years, with 49% male). Among 6,988 CKD patients, 2,560 (36.6%) experienced all-cause mortality. Increased PIV levels showed a strong independent association with higher CKD prevalence (OR = 1.69, 95% CI: 1.46-1.95) and all-cause mortality (HR = 1.47, 95% CI: 1.20-1.81). RCS analysis confirmed a nonlinear, progressively stronger association between PIV and CKD prevalence. A U-shaped link was found between PIV and all-cause mortality in CKD patients, with the inflection point at Log10-PIV 2.317. Mortality decreased before the inflection point and increased thereafter. Subgroup and interaction analyses showed their association was unaffected by covariates (all p > 0.05). Elevated PIV levels are linked to a higher incidence of CKD, while elevated or depressed PIV values are each linked to increased all-cause mortality risk among CKD patients.