The village of Hofwil was originally part of the lands owned by the
Münchenbuchsee Commandery 
, a medieval commandery of the Knights Hospitaller in nearby Münchenbuchsee. After the commandery was suppressed during the Protestant Reformation, Hofwil was owned by a number of nobles. In 1719 Hieronymus von Erlach combined the village with
Moosseedorf 
.
Hofwil Castle 
was built in 1784-86 by the architect Carl Ahasver von Sinner for Gabriel Albrecht von Erlach. A peristyle was added to the neo-classical building in 1798.