Terbinafine is used to treat fungal infections of the toenail and fingernail. Terbinafine is in a class of medications called antifungals. It works by stopping the growth of fungi.