Canonical Reference: Vasala Sutta (Discourse on Outcasts), Verse 142 Verified Source

“Not by birth does one become an outcast; not by birth does one become a Brahmin. By deeds alone does one become an outcast, by deeds alone does one become a Brahmin.”

Canonical Pali Original: Na jaccā vasalo hoti, na jaccā hoti brāhmaṇo; Kammunā vasalo hoti, kammunā hoti brāhmaṇo.

— Gautam Buddha
The Awakened One, Founder of Dhamma
Historical Setting & Context:

Delivered to the Brahmin Aggika Bharadvaja at Savatthi, repudiating ritual birth-hierarchy and establishing ethical conduct as the only measure of nobility.