Millennials love socialism — but only as long as they’re on the “to each according to his need” end.

The Cato Institute’s Emily Ekins has the numbers.

Yes, the under-30 crowd favors redistribution, with (for example) 69 percent telling Gallup they’d vote for a socialist president — like, say, like Bernie Sanders — compared to just a third of their parents’ generation.

But, she notes, “As they reach the threshold of earning $40,000 to $60,000 a year, the majority of millennials come to oppose income redistribution, including raising taxes to increase financial assistance to the poor.”

The same goes for millennials’ views on health care: Once they’re paying for their own coverage, a Reason-Rupe poll found, youngsters are no longer game for paying higher premiums to subsidize others’ insurance.

The irony here is that, if the country keeps heading toward ever more job-killing, big-government redistribution, these kids may never earn enough to wake up and oppose the racket.