This paper aims to analyze the concept and justification of the legality principle’s expansion in the Indonesian National Criminal Code and how its expansion is a manifestation of the idea of balance in the Indonesian criminal law’s renewal. This paper employed doctrinal legal research, i.e., a process to find legal regulations, principles, as well as doctrines to answer the legal issues being faced. Based on the research results, the formulation of the legality principle (formal) in the Criminal Code (WvS) was developed based on the certainty principle which is difficult to adapt with the development of the living law in society. Therefore, the National Criminal Code expands the meaning of the legality principle from having formal characteristics into a legality principle with material characteristics. It is specifically formulated in Article 2 clause (1) of Law No. 1 of 2023 on the National Criminal Code. According to this regulation, the legal source which states that an action is categorized as a criminal action based on the formal legality principle (based on the law as referred to in Article 1 clause (1)) does not decrease the application of the living law in society which determines that a person can be penalized even though his actions are not regulated in legal regulations. The insertion of the material legality principle in the National Criminal Code has the objective that the living law is also acknowledged as a legal source. The formulation of the material legality principle aims to protect the standard of values and norms that live in society to fulfill a sense of substantial justice. This is to create a balance between “legal certainty” and “justice”. Tujuan dari penelitian ini yaitu untuk menganalisis bagaimana konsep dan justifikasi perluasan asas legalitas dalam KUHP Nasional dan bagaimana perluasan asas legalitas sebagai wujud ide keseimbangan dalam pembaharuan hukum pidana Indonesia. Penelitian ini menggunakan penelitian hukum doktrinal, yaitu suatu proses untuk menemukan suatu aturan, prinsip, maupun doktrin-doktrin hukum guna menjawab isu hukum yang dihadapi. Berdasarkan hasil penelitian, formulasi asas legalitas (formil) dalam KUHP (WvS) dibangun di atas pondasi kepastian yang sulit beradaptasi dengan perkembangan hukum yang hidup di masyarakat. Oleh karena itu, KUHP Nasional memperluas makna asas legalitas dari yang sifatnya formil ke dalam asas legalitas yang sifatnya materil, tepatnya yaitu dirumuskan pada Pasal 2 ayat (1) KUHP Nasional. Menurut Pasal 2 ayat (1) KUHP Nasional, sumber hukum untuk menyatakan suatu perbuatan sebagai tindak pidana yang didasarkan pada asas legalitas formil (berdasarkan undang-undang sebagaimana dimaksud Pasal 1 ayat (1)) tidak mengurangi berlakunya hukum yang hidup dalam masyarakat yang menentukan bahwa seseorang patut dipidana walaupun perbuatan tersebut tidak diatur dalam undang-undang. Dimasukkannya asas legalitas materiel ke dalam KUHP Nasional bertujuan agar hukum yang hidup (the living law) juga diakui sebagai sumber hukum. Formulasi asas legalitas materiel bertujuan untuk melindungi standar nilai dan norma yang hidup di masyarakat demi memenuhi rasa keadilan yang substantif, sehingga akan terjalin keseimbangan antara “kepastian hukum” dan “keadilan”.