Wei Xiaokuan (韋孝寬) (509–580), formal personal name Wei Shuyu (韋叔裕) (but went by the courtesy name of Xiaokuan), known by the Xianbei name Yuwen Xiaokuan (宇文孝寬) during late Western Wei and Northern Zhou, formally Duke Xiang of Xun (勛襄公), was a general of the Chinese/Xianbei states Western Wei and Northern Zhou. He first became a prominent general during Western Wei as he defended the fortress of Yubi (玉壁, in modern Yuncheng, Shanxi) against a vastly larger army commanded by rival Eastern Wei's paramount general Gao Huan, and he eventually contributed greatly to the destruction of Eastern Wei's successor state Northern Qi by Northern Zhou. His final campaign, in 580, saw him siding with the regent Yan Jian against the general Yuchi Jiong in Northern Zhou's civil war, allowing Yang to defeat Yuchi and (after Wei's death) take over the throne as Sui Dynasty's Emperor Wen.
More so than other prominent generals at the time, Wei was known for using atypical strategies in both offense and defense, including extensive use of espionage and forgeries to undermine the morale of opposing forces.
Wei Xiaokuan was born in 509, during Western Wei's predecessor Northern Wei (which Western Wei and its rival Eastern Wei were divided from) -- specifically, during the reign of Emperor Xuanwu. His clan was a prominent one in the Sanfu (三輔, greater Chang'an) region, and both his grandfather Wei Zhishan (韋直善) and Wei Xu (韋旭) were commandery governors during Northern Wei. Wei Xiaokuan's given name was actually Wei Xiaoyu, but for reasons lost to history, he became known to others largely by his courtesy name of Xiaokuan.