The objective of this cross-sectional study was to explore sleep patterns and the potential relationship between sleep and tryptophan intake among Spanish university students. A total of 11,485 students self-reported their sleep and dietary patterns and habits. Tryptophan intake was calculated using a food intake matrix and results were presented as quartiles of total intake. Short sleep duration prevalence was 51.0%, with males exhibiting a significantly higher frequency. A total of 55.0% of participants presented inadequate sleep efficiency, with males again presenting a higher rate. Median tryptophan intake was 692.16 ± 246.61 mg/day, 731.84 ± 246.86 mg/day in males and 677.24 ± 244.87 mg/day in females (p = 0.001). Dietary tryptophan intake below the first quartile (<526.43 mg/day) was associated with a higher risk of short sleep duration in males (1.26; 95%CI: 1.02-1.55) and females (1.19; 95%CI: 1.05-1.34) and with the Athens Insomnia Scale insomnia in males (2.56; 95%CI: 1.36-4.82) and females (1.47; 95%CI: 1.10-2.05). Regarding academic specializations, females in the humanities field showed a higher risk of Athens Insomnia Scale insomnia due to low tryptophan intake (Q1: 3.15; 95% CI: 1.04-9.55 and Q2: 3.41; 95%CI: 1.01-11.5). In summary, lower tryptophan consumption appears to be associated with poorer sleep quality in Spanish university students; however, other social factors affecting students may also influence sleep quality. These findings have important implications for nutritional recommendations aimed at enhancing tryptophan intake to improve sleep quality.