Divalproex sodium affects chemicals in the body that may be involved in causing seizures. Divalproex sodium is used to treat various types of seizure disorders. Divalproex sodium is sometimes used together with other seizure medications. Divalproex sodium is also used to treat manic episodes related to bipolar disorder (manic depression), and to prevent migraine headaches. Divalproex sodium may also be used for purposes not listed in this medication guide.