Crabtree visited the Ravens on Friday after the free-agent contract wide receiver Ryan Grant had agreed to with the Ravens was voided because Grant did not pass the team physical.
"Michael has played very well against the Ravens, so we know first-hand the attributes he brings to the game," Ravens general manager Ozzie Newsome said in a statement. "He is a smart, tough, physical receiver who battles for the ball. We like his temperament and believe he is a good fit for our football team, on and off the field."
Crabtree, 30, has made 579 catches for 6,870 yards and 51 touchdowns in nine NFL seasons. He played six seasons in San Francisco after the 49ers made him a first-round pick.
He had 89 receptions for 1,003 yards and eight touchdowns in 2016 for the Raiders, but those numbers dropped to 58 catches, 618 yards and eight scores in 2017.