The origin is that a son of Takatoki HOJO's bereaved son Tokiyuki HOJO moved to Yokoe village, Aichi District, Owari Province (current Aichi Prefecture), and a child of Tokitoshi YOKOE, equivalent to a great-grandchild of Tokiyuki, changed his name to Yokoi.
北条高時の遺児北条時行の子が尾張国愛知郡(愛知県)横江村に住し、時行4世孫にあたる横江時利の子が、横井に改めたのがはじまり。