Ondansetron is used to prevent nausea and vomiting that is caused by cancer medicines (chemotherapy) or radiation therapy. It is also used to prevent nausea and vomiting that may occur after surgery.