Justin Bieber is getting support from one of his famous friends -- and it's someone who knows a thing or two about being locked up.
Floyd Mayweather offered Bieber some thoughts of encouragement Saturday afternoon via Twitter ... saying, "Keep your head up and know that you can overcome anything you are faced with in life. TMT supports you."
Of course, "Money's" bromance with Bieber is nothing new ... Justin walked Floyd into the ring at the Alvarez fight last year, and Jr. was a guest of honor at JB's famous Gatsby Party.
Mayweather's lengthy rap sheet probably factored in as well.