The move came on the eve of a speech by Mr. Obama to the N.A.A.C.P. in Philadelphia, where he plans to outline his proposals for revamping the juvenile and criminal justice systems, including sentencing guidelines, and to call on Congress to act this year. The commutations are also part of a broader effort by the president to use executive power and his influence on Capitol Hill to address racial disparities on a range of fronts, like overtime pay and residential segregation.

Mr. Obama personally notified each inmate in a letter that the sentences had been commuted. He said he had chosen them out of the thousands who applied because “you have demonstrated the potential to turn your life around.”

“I believe in your ability to prove the doubters wrong, and change your life for the better,” Mr. Obama wrote to the inmates, who will remain in prison until Nov. 10, when their sentences will expire. “So good luck, and godspeed.”

The commutations coincide with a second-term push by Mr. Obama to use clemency to correct what he sees as the excesses of the past, when tough-on-crime politicians instituted harsh sentences even for minor crimes. As a result, black and Hispanic men have been disproportionately affected.

“What the president is doing is showing the public through his power that there are people who are in jail for nonviolent drug offenses who have something to contribute to society and should not be there,” said Michael Collins, the policy manager at the Drug Policy Alliance. “The drug war has been a war on people of color,” and policies like mandatory minimum sentences “have really decimated these communities.”