Online patient portals are being widely implemented; however, no studies have examined whether portals influence health behaviors or outcomes similarly across patient racial/ethnic subgroups. We evaluated longitudinal changes in statin adherence to determine whether racial/ethnic minorities initiating use of the online refill function in patient portals had similar changes over time compared with Whites. We examined a retrospective cohort of diabetes patients who were existing patient portal users. The primary exposure was initiating online refill use (either exclusively for all statin refills or occasionally for some refills), compared with using the portal for other tasks (eg, exchanging secure messages with providers). The primary outcome was change in statin adherence, measured as the percentage of time a patient was without a supply of statins. Adjusted generalized estimating equation models controlled for race/ethnicity as a primary interaction term. Fifty-eight percent of patient portal users were white, and all racial/ethnic minority groups had poorer baseline statin adherence compared with Whites. In adjusted difference-in-difference models, statin adherence improved significantly over time among patients who exclusively refilled prescriptions online, even after comparing changes over time with other portal users (4% absolute decrease in percentage of time without medication). This improvement was statistically similar across all racial/ethnic groups. Patient portals may encourage or improve key health behaviors, such as medication adherence, for engaged patients, but further research will likely be required to reduce underlying racial/ethnic differences in adherence. In a well-controlled examination of diabetes patients’ behavior when using a new online feature for their healthcare management, patient portals were linked to better medication adherence across all racial/ethnic groups.