Allopurinol is used to treat gout, high levels of uric acid in the body caused by certain cancer medications, and kidney stones. Allopurinol is in a class of medications called xanthine oxidase inhibitors. It works by reducing the production of uric acid in the body. High levels of uric acid may cause gout attacks or kidney stones. Allopurinol is used to prevent gout attacks, not to treat them once they occur.