Objective: Osteoporosis (OP) is the most common bone disease. The genetic and metabolic factors play important roles in OP development. However, the genetic basis of OP is still elusive. The study aimed to explore the relationships between OP and dietary habits. Methods: This study used large-scale genome-wide association study (GWAS) summary statistics from the UK Biobank to explore potential associations between OP and 143 dietary habits. The GWAS summary data of OP included 9434 self-reported OP cases and 444,941 controls, and the GWAS summary data of the dietary habits included 455,146 participants of European ancestry. Linkage disequilibrium score regression (LDSC) was used to detect the genetic correlations between OP and each of the 143 dietary habits, followed by Mendelian randomization (MR) analysis to further assess the causal relationship between OP and candidate dietary habits identified by LDSC. Results: The LDSC analysis identified seven candidate dietary habits that showed genetic associations with OP including cereal type such as biscuit cereal (coefficient = −0.1693, p value = 0.0183), servings of raw vegetables per day (coefficient = 0.0837, p value = 0.0379), and spirits measured per month (coefficient = 0.115, p value = 0.0353). MR analysis found that OP and PC17 (butter) (odds ratio [OR] = 0.974, 95% confidence interval [CI] = (0.973, 0.976), p value = 0.000970), PC35 (decaffeinated coffee) (OR = 0.985, 95% CI = (0.983, 0.987), p value = 0.00126), PC36 (overall processed meat intake) (OR = 1.035, 95% CI = (1.033, 1.037), p value = 0.000976), PC39 (spirits measured per month) (OR = 1.014, 95% CI = (1.011, 1.015), p value = 0.00153), and servings of raw vegetables per day (OR = 0.978, 95% CI = (0.977, 0.979), p value = 0.000563) were clearly causal. Conclusions: Our findings provide new clues for understanding the genetic mechanisms of OP, which focus on the possible role of dietary habits in OP pathogenesis.