Summary Background Many people with epilepsy in low-income countries do not receive appropriate biomedical treatment. This epilepsy treatment gap might be caused by patients not seeking biomedical treatment or not adhering to prescribed antiepileptic drugs (AEDs). We measured the prevalence of and investigated risk factors for the epilepsy treatment gap in rural Kenya. Methods All people with active convulsive epilepsy identified during a cross-sectional survey of 232 176 people in Kilifi were approached. The epilepsy treatment gap was defined as the percentage of people with active epilepsy who had not accessed biomedical services or who were not on treatment or were on inadequate treatment. Information about risk factors was obtained through a questionnaire-based interview of sociodemographic characteristics, socioeconomic status, access to health facilities, seizures, stigma, and beliefs and attitudes about epilepsy. The factors associated with people not seeking biomedical treatment and not adhering to AEDs were investigated separately, adjusted for age. Findings 673 people with epilepsy were interviewed, of whom 499 (74%) reported seeking treatment from a health facility. Blood samples were taken from 502 (75%) people, of whom 132 (26%) reported taking AEDs, but 189 (38%) had AEDs detectable in the blood. The sensitivity and specificity of self-reported adherence compared with AEDs detected in blood were 38·1% (95% CI 31·1–45·4) and 80·8% (76·0–85·0). The epilepsy treatment gap was 62·4% (58·1–66·6). In multivariable analysis, failure to seek biomedical treatment was associated with a patient holding traditional animistic religious beliefs (adjusted odds ratio 1·85, 95% CI 1·11–2·71), reporting negative attitudes about biomedical treatment (0·86, 0·78–0·95), living more than 30 km from health facilities (3·89, 1·77–8·51), paying for AEDs (2·99, 1·82–4·92), having learning difficulties (2·30, 1·29–4·11), having had epilepsy for longer than 10 years (4·60, 2·07–10·23), and having focal seizures (2·28, 1·50–3·47). Reduced adherence was associated with negative attitudes about epilepsy (1·10, 1·03–1·18) and taking of AEDs for longer than 5 years (3·78, 1·79–7·98). Interpretation The sensitivity and specificity of self-reported adherence is poor, but on the basis of AED detection in blood almost two-thirds of patients with epilepsy were not on treatment. Education about epilepsy and making AEDs freely available in health facilities near people with epilepsy should be investigated as potential ways to reduce the epilepsy treatment gap. Funding Wellcome Trust.