We investigated factors affecting the low- and high-risk groups for aspiration by measuring gastric volume with ultrasound in diabetic patients who fasted for elective surgery. The study was conducted as an observational study. Sixty-five patients scheduled for elective surgery, aged 18-86 years, with American Society of Anesthesiologists (ASA) scores II-III, and who have diabetes were included after local ethics committee approval. Written informed consent was obtained from all participants. Demographic data of cases were recorded. Patients whose gastric residual volume (GRV) was calculated using the pupils equal, round, reactive to light, and accommodation (PERLA) formula following gastric antrum measurement in the right lateral decubitus and supine position by ultrasound were categorized as low or high risk for aspiration. Thirty-one patients were in the low-risk group, and 34 patients were in the high-risk group. Sex, weight, body mass index (BMI), hemoglobin A1c (HbA1c) values, and duration of diabetes were not statistically significant (p > 0.5). Age (p = 0.006) and fasting blood glucose (FBG) (p = 0.005) were statistically significant. The risk of aspiration decreases with age. Hyperglycemia is related to delayed gastric emptying and a high risk for aspiration. The duration of fasting, GRV, and cross-sectional area (CSA) were statistically significant (p = 0.017, p = 0.000, and p = 0.000, respectively). Gastric emptying might be delayed in diabetic patients resulting in a high risk for aspiration pneumonia. The risk of aspiration increases in young diabetic patients, and preoperative FBG measurements can provide an idea about gastric emptying in diabetic patients. Gastric ultrasound (USG) may contribute to guidelines for determining more appropriate fasting times for other patient populations, such as obese, pregnant, or child patients.