Food security is determined not only by food availability but also by the diversity and nutritional balance of household consumption, which in Indonesia is measured by the Desirable Dietary Pattern score. Geographic, social, and economic differences among provinces lead to widely varying scores, while objective, updatable mappings remain limited. This study aimed to map Indonesian provinces based on their Desirable Dietary Pattern scores, to analyze the spatial and temporal characteristics of each group, and to implement the K-Means Clustering algorithm in a web-based system. The data consisted of 242 provincial score records for 2018–2024 obtained from the Indonesian One Data portal. The data were normalized with the Min-Max method and grouped into three clusters using Euclidean distance, with initial centroids taken from the highest, median, and lowest values. The number of clusters was examined with the Elbow method, cluster quality was assessed with the Silhouette Score and the Davies-Bouldin Index, and the stability of the results was tested through a sensitivity analysis of 100 random and 100 K-Means++ initializations together with a computational runtime measurement. The algorithm converged at the fifth iteration and produced a High cluster of 84 records (centroid 91.08), a Medium cluster of 109 records (centroid 83.43), and a Low cluster of 49 records (centroid 74.12). A Silhouette Score of 0.578 and a Davies-Bouldin Index of 0.516 indicated a good cluster structure. The three initialization strategies differed in the membership of only two records lying at cluster boundaries, while the deterministic initialization converged in 5 iterations with a median runtime of 0.16 ms, faster than random initialization (0.29 ms) and K-Means++ (0.30 ms). The number of provinces in the High category rose from 5 in 2018 to 22 in 2024, whereas East Nusa Tenggara and Maluku consistently remained in the Low category. The web system produced results identical to the manual calculation, making it a suitable tool for prioritizing food security policy. The contributions of this study are (1) a reproducible K-Means procedure with deterministic initialization whose stability has been tested, (2) a seven-year category map of the Desirable Dietary Pattern scores of all provinces with explicit score boundaries between categories, and (3) a transparent, updatable web-based system that supports the prioritization of food security policies.