Steyn retired from the five-day game in 2019 but had been available for limited-overs cricket and hoped to play at the Twenty20 World Cup in the United Arab Emirates later this year, though he had not featured in the team since February last year.
"It has been 20 years of training, matches, travel, wins, losses, strapped feet, jet lag, joy and brotherhood. Today I officially retire from the game I love the most. Bittersweet, but grateful," Steyn said in a statement.
He took 699 international wickets, including a South African record 439 in Tests, and is regarded as one of the best fast bowlers of his generation with extreme pace in his prime and the ability to swing the ball in both directions.
Steyn would have taken many more wickets but for injuries later in his career, especially a shoulder problem that restricted him to only 11 Tests after 2015. He featured in 93 in all, averaging 22.95 with the ball at a strike rate of 42.30.
He was a key part of the South African side that rose to number one in the test rankings in 2012.