Ketoconazole is used to treat skin infections such as athlete's foot, jock itch, ringworm, and certain kinds of dandruff. This medication is also used to treat a skin condition known as pityriasis (tinea versicolor), a fungal infection that causes a lightening or darkening of the skin of the neck, chest, arms, or legs. Ketoconazole is an azole antifungal that works by preventing the growth of fungus.