BackgroundAlthough there is numerous evidence on the epidemiological risk factors for insulin resistance (IR)-related metabolic diseases, there is still insufficient evidence to explore the non-linear association of Atherogenic Index of Plasma (AIP) with IR. Therefore, we aimed to elucidate the non-linear relationship between AIP and IR and type 2 diabetes (T2D).MethodsThis cross-sectional study was conducted in the National Health and Nutrition Survey (NHANES) from 2009 to 2018. A total of 9,245 participants were included in the study. The AIP was calculated as log10 (triglycerides/high-density lipoprotein cholesterol). The outcome variables included IR and T2D defined by the 2013 American Diabetes Association guidelines. The weighted multivariate linear regression, weighted multivariate logistic regression, subgroup analysis, generalized additive model, smooth fitting curve and two-part logistic regression were adopted to reveal the relationship of AIP with IR and T2D.ResultsAfter adjustment for age, gender, race, education level, smoking status, alcohol consumption, vigorous/moderate physical activity, body mass index, waist circumference and hypertension, we found that AIP was positively associated with fasting blood glucose (β = 0.08, 95% CI: 0.06, 0.10), glycosylated hemoglobin (β = 0.04, 95% CI: 0.39, 0.58), fasting serum insulin (β = 4.26, 95% CI: 3.73, 4.79), and homeostasis model assessment of insulin resistance (β = 0.22, 95% CI: 0.18, 0.25). Further studies found that AIP was associated with increased risk of IR (OR = 1.29, 95% CI: 1.26–1.32) and T2D (OR = 1.18, 95% CI: 1.15–1.22). However, the positive association between AIP and IR or T2D was more significant in female than in male (IR: P for interaction = 0.0135; T2D: P for interaction = 0.0024). A non-linear and inverse L-shaped association was found between AIP and IR, while a J-shaped association was found between AIP and T2D. In patients with − 0.47 < AIP < 0.45, increased AIP was significantly associated with increased risk of IR and T2D.ConclusionsAIP showed an inverse L-shaped association with IR and a J-shaped association with T2D, indicating that AIP should be reduced to a certain level to prevent IR and T2D.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12933-023-01886-5.