Ketoconazole is used to treat skin infections such as athletes 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.