A pill container has a body, multiple lids, and multiple resilient pushing bars. The body has a front wall, a rear wall, multiple compartments, and multiple locking buttons. The locking button are formed on the front wall of the body and aligned respectively with the compartments. The lids are connected pivotally to the rear wall of the body to selectively close the compartments respectively and are engaged detachably with the locking buttons respectively. Each lid has an inner surface facing a corresponding one of the compartments of the body. The resilient pushing bars are mounted on the rear wall of the body and respectively abut against the inner surfaces of the lids.