The development of digital technology has fueled the rise of online gambling in Indonesia, involving not only adult men but also children, adolescents, and women. This phenomenon is a serious problem because gambling is illegal and has negative impacts on both individuals and society. Although regulations are stipulated in Article 303 of the Criminal Code and Law Number 1 of 2024 (amendments to the ITE Law), the effectiveness of law enforcement remains low. This study aims to analyze the correlation between legal knowledge and public legal awareness and compliance with the prohibition on online gambling. The method used is normative legal research with a statutory regulatory approach and a conceptual approach. Data were obtained from primary and secondary legal materials through document studies, then analyzed qualitatively using legal interpretation and argumentation. The results show that some people have legal knowledge related to the prohibition on online gambling, but this is not yet in line with law-abiding behavior. Low legal awareness, influenced by social, economic, and environmental factors, keeps online gambling rampant despite the clear threat of sanctions. Legal awareness plays a crucial role because it includes the internalization of legal values that shape attitudes and behavior, not simply an understanding of the rules. The correlation between legal knowledge and legal awareness is significant for compliance, with legal awareness acting as a bridge between knowledge and action. The conclusion of this study confirms that increasing legal literacy through digital education, regulatory dissemination, and moral development, along with consistent law enforcement, is a key strategy for curbing online gambling practices. These preventive efforts are crucial for ensuring sustainable legal compliance in the digital age.