Emperor Xiaowen of Northern Wei
It is not known when Zhangsun Wuji was born, but what is known is that he was older than his sister, the future Empress Zhangsun, who was born in 601. It was written that his ancestors traced their origin to the Xianbei dynasty Northern Wei's founding emperor Emperor Taiwu of Northern Wei's 17th generation ancestor Tuoba Kuaili (拓拔儈立) — that their ancestor was Tuoba Kuali's third son, who took the surname Baba (拔拔), eventually changed to Zhangsun when Emperor Xiaowen of Northern Wei changed Xianbei surnames to Han surnames in 496.