M4 is the armed force's designation for a model of shortened m16 type rifles. M4s have a 14.5 inch barrel with an m203 cut, a collapsible stock, different feed ramps, a carbine length gas system, and most importantly a selector for safe/semi/burst fire. A regular m4 fires in 3 round bursts, while an m4a1 has a fully automatic setting.
That being said, I have never seen a real m4 for sale. I have seen converted m16s, but never a genuine transferable m4 carbine on the market.
The "m4" rifles marketed to civilians do not even have the 14.5 inch barrel, but rather a 16 inch barrel that retains the m203 cut (for some reason) and the collapsible stock. Sometimes these rifles do not even have true m4 feed ramps. I personally do not like semi automatic ar15 carbines to have the m203 cut, as I do not plan to install a grenade launcher.