Hiatal hernia is classified into four types: type I (sliding hiatal hernia), type II (paraesophageal hernia with fixed gastroesophageal junction), type III (combined sliding and paraesophageal hernia), and type IV (other viscera herniate into the mediastinum, commonly the colon).