 It is used primarily to treat epilepsy and bipolar disorder.It is also used to prevent migraine headaches.Valproate has a broad spectrum of anticonvulsant activity, although it is primarily used as a first-line treatment for tonic–clonic seizures, absence seizures and myoclonic seizures and as a second-line treatment for partial seizures and infantile spasms.