Jail replaced gaol (same pronunciation) as the preferred spelling in American English in the early 1800s and British English in the mid-1900s.