Anharmonicity in grain boundary (GB) energies for Al is elucidated by employing a thermodynamic integration method with a high-accuracy artificial-neural-network potential. Symmetric tilt GBs with the [001] and [11¯0] rotational axes are examined. It is found that anharmonic components tend to be small at low temperatures and increasingly contribute to reduction of GB free energies at elevated temperatures. The magnitude of anharmonicity is roughly correlated with excess volume at GBs. This is presumably because GB atoms tend to have longer bond lengths than the bulk atom, and hence the inclination of the potential energy surface at GBs is more moderate than in the bulk. On the other hand, the Σ13(510) GB takes non-negligible values of the anharmonic component even at intermediate temperatures. This GB contains a distinct atom around which the potential-energy curve significantly deviates from that of the harmonic approximation. Similar trends are also observed for other [001] GBs.