Terms were not released by the Colts.
In a corresponding move, the Colts waived center Alex Mollette.
Williams, 25, rushed for 185 yards and a touchdown in 13 games (three starts) last season as a rookie. He also caught nine passes for 84 yards. He played 40 snaps on special teams.
Williams joins a running back room of Jonathan Taylor, Nyheim Hines, Phillip Lindsay and Deon Jackson in Indianapolis.
Williams was waived by the Ravens to make room for RB Mike Davis.