Objective: This study aims to explore the differences in cerebrospinal fluid oligoclonal band (CSF-OCB) expression among different age groups in viral encephalitis and its reference value for diagnosis. Methods: Forty-two patients with viral encephalitis were divided into two groups: 25 adults and 17 children. The presence of oligoclonal bands in the cerebrospinal fluid (CSF) was detected using polyacrylamide gel electrophoresis, and CSF routine analysis was conducted for comparative analysis. Results: The CSF-OCB positivity rate was higher in the adult group (48%) compared with the pediatric group (11.76%), with a statistically significant difference (P < 0.05). There was no significant difference in adult group between the CSF-OCB positivity rate (48%) and CSF white blood cell count positivity rate (44%), but was higher than the protein quantification analysis positivity rate (20%), with statistical significance (P < 0.05). In the pediatric group, there was no significant difference between the CSF-OCB positivity rate (11.76%) and protein quantification analysis positivity rate (17.65%), but it was lower than the CSF white blood cell count positivity rate (64.71%) (P < 0.05). Conclusion: 1) The expression of CSF-OCB positivity in patients with viral encephalitis is age-related, with higher positivity rates observed in adults compared to children. 2) Although CSF oligoclonal band detection is not a specific diagnostic marker for viral encephalitis in adults, it still holds certain reference value.