I don't think Trump is the worst ever but he certainly is on the podium. I would say Andrew Johnson as his failure during reconstruction (also the last president to skip the swearing in of the subsequent administration) is the worst. His support of outright racism and injustice (Jim Crow) after Lincoln reverberates to this day. Hard to compete with that infamous standing. I may also rank Buchanan (Dred Scott, etc.) ahead of Trump because he effectively led the country into civil war. Then Trump...he's not even the best at being the worst.
I kid, he's the worst president in modern history but not all time IMO.