The aim of this study was to investigate risk factors for ocular toxoplasmosis (OT) in patients who received medical attention at a public health service. Three hundred and forty-nine consecutive patients, treated in the Outpatient Eye Clinic of Hospital de Base, São José do Rio Preto, São Paulo state, Brazil, were enrolled in this study. After an eye examination, enzyme-linked immunosorbent assay (ELISA) was used to determine anti-Toxoplasma gondii antibodies. The results showed that 25·5% of the patients were seronegative and 74·5% were seropositive for IgG anti-T. gondii antibodies; of these 27·3% had OT and 72·7% had other ocular diseases (OOD). The presence of cats or dogs [odds ratio (OR) 2·22, 95% confidence interval (CI) 1·24–3·98, P = 0·009] and consumption of raw or undercooked meat (OR 1·77, 95% CI 1·05–2·98, P = 0·03) were associated with infection but not with the development of OT. Age (OT 48·2 ± 21·2 years vs. OOD: 69·5 ± 14·7 years, P < 0·0001) and the low level of schooling/literacy (OT vs. OOD: OR 0·414, 95% CI 0·2231–0·7692, P = 0·007) were associated with OT. The presence of dogs and cats as well as eating raw/undercooked meat increases the risk of infection, but is not associated with the development of OT.