Pediatric patients identified at increased risk for headache due to ocular refractive errors were evaluated to produce a diagnostic tool called the HAMS score that will help establish the likelihood of headache due to refractive errors.Methods Data on the ocular diagnosis and headache complaints of 726 pediatric patients of both sexes were obtained from the medical records of an ophthalmological service in Brazil (Hospital de Olhos Santa Luzia). Age, use of glasses, and ocular diagnosis were also considered to create an index based on the number of ocular diagnoses in a given individual (HAMS score) to verify their association with the incidence of headache. Once the database was finalized, it was then analyzed to identify the variables capable of predicting the occurrence of headaches, following which a profile of those at the highest risk was produced by comparison.Results Only the ocular diagnosis was significantly associated with headache as a function of sex, age, use of glasses, farsightedness, astigmatism, myopia, and strabismus, indicating the relative impact of each ocular diagnosis on the probability of headache. According to the HAMS score, strabismus is more likely to have headache (5.21), followed by hyperopia (3.10), myopia (2.67), and, finally, astigmatism (1.86). The findings showed that the presence or absence of refraction errors and strabismus is predictive of the occurrence of headache, particularly in a small group of patients (6.2%) where the probability of headache was 57.8%. Such patients were characterized by being younger, having a combination of strabismus, hyperopia, and astigmatism, and already be using corrective lenses.Conclusion The index based on the most common ocular diagnoses (HAMS score) is effective, and it has practical application in identifying children and adolescent patients with a greater or lesser propensity for headaches of ophthalmic origin.