This study aims to analyze the freedom of contract as stated in article 1338 of the Indonesian Civil Code (KUH-Perdata). Freedom of contract is a very important principle in contract law. This freedom is a manifestation of the free will of a human right. This principle relates to the contents of the agreement to determine what and with whom the agreement is made. Globalization has brought changes to areas of life, including buying and selling. Information technology that is increasingly advanced is one of the factors driving the development of e-commerce. Information and communication technology has changed the behavior of society and human civilization globally. This development causes the world to become borderless. However, this is like a double-edged sword, besides providing convenience in transactions, on the other hand it can be an effective means of committing acts against the law. The existence of e-commerce is a promising business alternative because it provides convenience in transactions, both from the seller and the buyer in carrying out trade transactions. E-commerce makes parties do not need to meet face to face in conducting transactions and negotiations. However, e-commerce transactions erode their rights in terms of freedom of contract because they only agree to an agreement in making a transaction. This research is intended to provide an argument or opinion in a juridical manner where this research uses a normative method (doctrinal legal research). With research using normative methods, this research focuses on literature studies. The results of this study are how civil law can guarantee freedom of contract for consumers who make e-commerce transactions.