Sofosbuvir is used along with ribavirin (Copegus, Rebetol) and sometimes another medication (peginterferon alfa [Pegasys] to treat chronic hepatitis C (an ongoing viral infection that damages the liver). Sofosbuvir is also used along with ribavirin (Copegus, Rebetol) in people with liver cancer and hepatitis C infection who are waiting for a liver transplant to treat hepatitis C infection and to decrease the risk of reinfection after the transplant. Sofosbuvir is in a class of antiviral medications called nucleotide polymerase inhibitors. It works by decreasing the amount of hepatitis C virus (HCV) in the body. Sofosbuvir may not prevent the spread of hepatitis C to other people.