Rizal was a 5th-generation patrilineal descendant of Domingo Lam-coLam-co married Inez de la Rosa, aSangley of Luzon. José Rizal also had Spanish and Japanese ancestors. His grandfather and father of Teodora was a half-caste Spaniard engineer named Lorenzo Alberto Alonzo. His maternal great-great-grandfather was Eugenio Ursua, a descendant of Japanese settlers. In 1849, then Governor-General of the Philippines Narciso Claveria, issued a Decree by which native Filipino and immigrant families were to adopt Spanish surnames from a list of Spanish family names. Although the Chino Mestizos were allowed to hold on to their Chinese surnames, Lam-co changed his surname to the Spanish "Mercado" (market), possibly to indicate their Chinese merchant roots.

José's father Francisco adopted the surname "Rizal" (originally Ricial, the green of young growth or green fields), which was suggested to him by a provincial governor, or as José had described him, "a friend of the family". However, the name change caused confusion in the business affairs of Francisco, most of which were begun under the old name. After a few years, he settled on the name "Rizal Mercado" as a compromise, but usually just used the original surname "Mercado".

Upon enrolling at the Ateneo Municipal de Manila, José dropped the last three names that make up his full name, at the advice of his brother, Paciano Rizal Mercado, and the Rizal Mercado family, thus rendering his name as "José Protasio Rizal". Of this, Rizal writes: "My family never paid much attention [to our second surname Rizal], but now I had to use it, thus giving me the appearance of an illegitimate child!" This was to enable him to travel freely and disassociate him from his brother, who had gained notoriety with his earlier links with native priests who were sentenced to death as subversives. From early childhood, José and Paciano were already advancing unheard-of political ideas of freedom and individual rights which infuriated the authorities. Despite the name change, José, as "Rizal" soon distinguishes himself in poetry writing contests, impressing his professors with his facility with Castilian and other foreign languages, and later, in writing essays that are critical of the Spanish historical accounts of the pre-colonial Philippine societies. Indeed, by 1891, the year he finished his El filibusterismo, this second surname had become so well known that, as he writes to another friend, "All my family now carry the name Rizal instead of Mercado because the name Rizal means persecution! Good! I too want to join them and be worthy of this family name...".