Viljandi (, ) is a town and municipality in southern Estonia. As of 2012, 19,150 people lived there. It is the capital of Viljandi County. The town was first mentioned in 1283, after being given its town charter by Villekinus de Endorpe.