The subway trains keep getting dirtier and dirtier.

Only 42 percent of cars systemwide were considered clean in a recent “shmutz” study by the Straphangers Campaign.

It was a 10 percent drop from 2011, when 52 percent of the trains met cleanliness standards — and was an almost 15 percent drop from 2008.

The D train was the most dismal, with 83 percent of cars found to be dirty — a jump from 51 percent in 2011.

“There’s the usual puke and pee, at least, weekly,” said Trey Shelton, 35, who lives on the Lower East Side. “You’ll see it as you’re riding, just see some bad hygiene. By now, I’ve learned the trick: If a car looks really empty, it’s too good to be true.”

The D was one of nine subway lines getting grosser, according to the study. The L train did the best for subway hygiene, with 63 percent of cars considered clean.

Volunteers observed 2,000 subway cars in the survey between last September and December.

Cars were rated clean if they were dirt-free or had light dirt. They were considered moderately dirty if they had dingy floors or sticky dry spots.

The filthiest cars had open or spilled food, sticky wet spots or unusable seats.

“Transit officials are losing the war against dirty subway cars,” said Jason Chin-Fatt, of the Straphangers Campaign.

Jan Fiedler, 33, said some riders treat the subway like their bathroom or leave behind food containers. “They just finish the food and throw it underneath. You smell things.”

The MTA said subway cars are cleaned regularly at terminals and more thoroughly at yards.

The MTA conducts its own subway-cleanliness surveys and said the Straphangers’ study of looking at cars in service is flawed.

“It’s like telling someone their teeth are dirty because they haven’t brushed since this morning,” said a spokesman. “We simply disagree with the Straphangers’ flawed methodology.”