Earnshaw is the only player to score a hat-trick in the Premier League, FA Cup, Championship, League One, League Two, League Cup and an international.
He represented Wales 59 times in an 18-year career that saw him score 236 goals for 11 clubs in six countries.
"I've always been scared to see the end of my playing days and now that it's here I'm sad," said Earnshaw, 34.
The Zambian-born striker broke goal-scoring records at his first club Cardiff City as his 35 goals in their 2002-03 League One promotion season beat Stan Richards' 56-year club record.
Earnshaw won the first of his Wales caps against Germany in 2002 and scored the winner against a team who were World Cup runners-up later that summer in Japan.
Earnshaw ended his Wales career joint seventh alongside Mark Hughes and Cliff Jones on Wales' all-time list of scorers with 16 goals, the highlight being a hat-trick at home to Scotland in 2004.
West Bromwich Albion broke their transfer record to sign Earnshaw from Cardiff for £3.5m in 2004 before he signed for Norwich in 2006.
He became Derby County's record £3.5m signing in 2007 and also played for Nottingham Forest, Maccabi Tel Aviv in Israel before finishing his career in North America's Major League Soccer with spells at Toronto, Chicago Fire and Vancouver Whitecaps.
Having retired from playing for the Whitecaps he will now become their first-team striking coach and work with their under-14 side.
"In a way, football has been like a father to me. It has taught me about life, about working hard and staying focused," he explained.
"Football taught me how to be a man on and off the field and to be a better person."
Former Wales international Robert Earnshaw has admitted his "sadness" after retiring from football.