We obtain a necessary and sufficient condition on an exponent p(•) for which the Hardy-Littlewood maximal operator is bounded on the variable L p(•) space. It is formulated in terms of the Muckenhoupt-type condition A p(•) , responsible for a local control of p(•), and a certain integral condition on p(•), responsible for the behaviour of p(•) at infinity. Our approach is based on an earlier characterization established by L. Diening and on non-increasing rearrangements.2020 Mathematics Subject Classification. 42B25, 42B35.