The genealogies of Jesus found in the Gospels of Matthew and Luke serve different purposes and perspectives, which is why they appear to differ.
Matthew traces Jesus’ lineage through Joseph, showcasing His royal descent from King David, emphasizing Jesus’ rightful place in Jewish history as the Messiah. He organizes the genealogy into three sets of fourteen generations (Matthew 1:17). On the other hand, Luke presents a more universal perspective by tracing Jesus’ lineage back to Adam, highlighting His connection to all humanity. In this account, Luke also emphasizes Mary’s side of the family by including her ancestry through Joseph (Luke 3:23-38).
These differences provide rich insights into how each Gospel writer sought to communicate who Jesus is—a fulfillment of Jewish prophecy and a Savior for all people.