PRESIDENT OBAMA went somewhere Thursday that, according to the White House, no other sitting president ever has: a federal prison. His point was that no advanced society should be comfortable with the way this country punishes crime. The nation locks up too many people for too long, and it too often treats them poorly behind bars. In part because of Mr. Obama — but also because of a strong left-right alliance that includes the Koch brothers, the American Civil Liberties Union and others in between — change could come very soon. If, that is, Congress acts.

The case for reform starts with the eye-popping fact that the United States has 5 percent of the world’s population but 25 percent of its prisoners, in large part because of drug crime sentences. The country’s federal imprisonment rate is up more than five times from 1980, multiplying federal prison costs by nearly six times, according to the Pew Charitable Trusts. “Up to a certain point, tougher prosecutors and stiffer sentences for these violent offenders contributed to the decline in violent crime over the last few decades,” Mr. Obama conceded this week. But, he added, “the science also indicates that you get a point of diminishing returns,” particularly when non-violent and low-level offenders get hit with harsh sentences.

Mass incarceration also seems plainly impractical because there are a variety of more appealing options that many states have been experimenting with. The state prison population dropped between 2003 and 2013, while the federal prison population increased. While many states are looking at innovative ways to treat people more fairly and save money, the Justice Department is seeing an ever-larger percentage of its budget go to prison spending.

Mr. Obama and a bipartisan gaggle of federal lawmakers want to apply the states’ insights to the federal system. The most significant bill on the table — the House’s Safe, Accountable, Fair, and Effective (SAFE) Justice Act — would reserve drug trafficking life sentences and other major penalties for drug bosses rather than low-level dealers, give more sentencing flexibility to judges and focus federal resources away from drug possession enforcement. It would create specialized courts for drug crimes and the mentally ill. It would also put a much greater emphasis on prison programming — job training, mental-health care, substance-abuse treatment — and better post-release supervision.

The bill isn’t perfect. It wouldn’t give felons who have served their time the right to vote in federal elections, for example. Nor would it do enough to cut back on the rampant overuse of solitary confinement. “Do we really think it makes sense to lock so many people alone in tiny cells for 23 hours a day, sometimes for months or even years at a time?” Mr. Obama asked this week. States such as Colorado, Maine and Mississippi are drastically reducing their use of solitary. Mr. Obama has ordered a Justice Department review. But Congress doesn’t need to wait for the results; the horrifying scandal of America’s overuse of solitary confinement is already well-known.

House Speaker John A. Boehner (R-Ohio) promised Thursday to give floor time to criminal justice reform. Lawmakers should take the opportunity to be as comprehensive as possible. A smarter justice system less focused on long prison terms and more focused on fitting punishments to crimes and preventing recidivism would be truer to the country’s commitment to individual liberty and almost certainly better for government finances and community cohesion.

View this article online here.