Edit
The M4 Carbine is an American 5.56mm NATO assault rifle introduced in 1994. It is based on the shorter and lighter version of the M16A2.
This tag applies to all variants of the rifle, such as the M4 with SOPMOD II set of attachments, Mk 18 CQBR carbine with shorter upper receiver, and many more.
If you are seeing what appears to be M4-like rifle on images that takes place before the mid-1990s (i.e. during Vietnam War), the protruding barrel length is notably shorter in comparison with the forearm, or if the gun lacks more recent tactical features like Picatinny rails (post #6130843 for example) - then it is the Colt Commando.
See also
The following tags are aliased to this tag: m4_sopmod_ii, m4a1, and mk_18_carbine (learn more).
This tag implicates assault_rifle (learn more).