"pen for pigs," Old English sti, stig "hall, pen" (as in sti-fearh "sty-pig"), from Proto-Germanic *stijan (source also of Old Norse stia "sty, kennel," Danish sti, Swedish stia "pen for swine, sheep, goats, etc.," Old High German stiga "pen for small cattle"). Meaning "filthy hovel" is from 1590s.