The elliptic flow of prompt and non-prompt J/ψ was measured in the dimuon decay channel in Pb+Pb collisions at sNN−−−√=5.02 TeV with an integrated luminosity of 0.42 nb−1 with the ATLAS detector at the LHC. The prompt and non-prompt signals are separated using a two-dimensional simultaneous fit of the invariant mass and pseudo-proper decay time of the dimuon system from the J/ψ decay. The measurement is performed in the kinematic range of dimuon transverse momentum and rapidity 9<pT<30 GeV , |y|<2 , and 0–60% collision centrality. The elliptic flow coefficient, v2 , is evaluated relative to the event plane and the results are presented as a function of transverse momentum, rapidity and centrality. It is found that prompt and non-prompt J/ψ mesons have non-zero elliptic flow. Prompt J/ψ v2 decreases as a function of pT , while for non-prompt J/ψ it is, with limited statistical significance, consistent with a flat behaviour over the studied kinematic region. There is no observed dependence on rapidity or centrality.