Military uniform
The U.S. Army is still in transition between the old ACU pattern and the new OCP pattern. The U.S. Military uses different camo patterns when deployed in different combat zones (in theater). U.S. Army mostly uses the Multi-Cam pattern in Iraq and Afghanistan, but is subject to change due to the new OCP uniform being issued.

Based on recommendations made during a comprehensive briefing by Task Force Uniform on 24 Feb. 2006, CNO Michael G. Mullen agreed to production of both a BDU-style working uniform for all Sailors E-1 to O-10 and a more practical, year-round service uniform to withstand day-to-day classroom and office-like environments where the service uniform is typically worn. The new Navy Working Uniform (NWU) is now worn by naval sailors and officers. On 6 June 2006 the US Army announced that its green and white uniforms would be superseded by the Army Blue Uniform as a universal service uniform in the historic colours of dark blue (for tunics) and light blue (for trousers). The new service dress was introduced in 2007 and became obligatory for all ranks by 2011.
As of 1 April 2021, the Air Force makes use of the Operational Camouflage Pattern (OCP) as a common daily uniform. This is the same uniform worn by the US Army with the exception of distinctive name patches with copper lettering. The footwear worn with ABUs are coyote brown suede boots and head covering is the OCP pattern Patrol Cap or ball cap, or the beret of the relevant career field (Security Forces, Special Operations Weather Team, SERE Instructor, Pararescue, and Combat Controller). Aside from OCPs, the most common uniform to be worn would be dress blues, which incorporate a light navy blue for bottoms, and the same shade to match the top jacket. Underneath the top jacket either a long sleeve or short sleeve sky blue shirt may be worn with a tie or neck tab whenever wearing the top jacket. The jacket is reserved for more formal events. Placed on the outermost tunic, Airmen may pin their ribbons and career badge as optional with their name plate as the only mandatory item. For headgear a flight cap of matching shade to the pants and similar in appearance to the former Army green garrison cap and the shoes are a black high polished dress shoe. Other, but not standard, headgear includes the flat top mess dress cap and the appropriate beret career field beret. Blues, though the second most used uniform, receive far less service than OCPs. Those performing duties not suited for the formal dress uniform may wear OCPs instead. The Mess Uniform uses the same pants and jacket as dress blues, but with a white under-shirt, bow tie and cummerbund, and the same black dress shoes.

Purpose: 

Distinctive clothing: One purpose of military uniforms is to clearly distinguish combatants who are protected by the laws of war from other persons carrying weapons, who do not always enjoy such protection.
Another purpose in historical times was to make it difficult for deserters to avoid detection; military uniforms were so distinctive with many metal buttons and unique colours that they could not be modified into unrecognisable clothing. If the commander raised and equipped the troops out of his own pocket, the appearance of the soldiers was also designed to impress his superiors.
Attractive or distinctive uniforms could make a military career desirable to young men or women (the "peacock" factor). As late as 1914 the British Army found that regiments with particularly striking off-duty or parade uniforms found it easier to attract recruits. Thus the four Rifle regiments in their sombre dark green had a higher public profile than the great mass of line infantry in scarlet.

Nationalism: During the Boxer Rebellion, the Muslim Gansu Braves under General Dong Fuxiang used traditional Chinese clothing instead of western-style uniforms, reflecting the opposition of the movement to foreign influences.

Religion: The patched jibba, a garment traditionally worn by followers of Sufi religious orders, was adopted as military dress in the 1880s by the Sudanese anṣār (Arabic: أنصار) (followers of the religious leader Muhammad Ahmad al-Mahdi). The Anṣār rebelled against the Turkish Ottoman rule of Sudan, due, among other reasons, to the lax religious standards of the occupation. The jibba was a ragged, patched garment which symbolised a rejection of material wealth by its wearer and a commitment to a religious way of life. Muhammad Ahmad al-Mahdi decreed that this garment should be worn by all his soldiers in battle.  The decision to adopt the religious garment as  military dress, enforced unity and cohesion among his forces, and eliminated traditional visual markers differentiating potentially fractious tribes. During the years of conflict between Mahdist and Anglo-Egyptian forces at the end of the 19th century, the Mahdist military jibba became increasingly stylised and were specifically colour-coded to denote the rank and military division of the wearer.

Visibility or camouflage: Throughout the 18th and 19th centuries, the typical colour scheme included bright and highly contrasting colour arrangements which made it easier to distinguish units in battle.  Coloured uniforms were useful in enabling commanders to spot troop locations on battlefields that were often completely obscured by smoke from the black gunpowder used in both muskets and cannons. Large flags were another aid to co-ordination and location for commanders.
However, with the growing prevalence of accurate rifles and other ranged firearms as standard weapons for infantry, it was found, from about the 1880s on, that these colours made soldiers easy targets for enemies to shoot at a distance. These weapons used a new smokeless powder that generated far less smoke leaving the battlefield un-obscured by smoke and making brightly coloured troops into highly visible targets.  In reaction, the various militaries, beginning with the British Army, changed the colours, predominantly to such ones that blended in more with the terrain, such as khaki, grey or olive drab for the purposes of camouflage. In addition, this idea was followed with uniforms suitable for particular climates and seasons such as white for snowy regions and tan for sandy ones. Now most armies have some form of camouflaged uniform, such as the British Disruptive Pattern Material.

Many modern military forces now use a system of combat uniforms that not only break up the outline of the soldier for use on the battlefield during the daytime, but also employ a distinctive appearance that makes them difficult to detect with light amplification devices, such as night-vision goggles (NVGs).  These modern "digital" print uniforms present a somewhat splotched appearance, generally of somewhat muted colours, that provide visual concealment in a variety of surroundings. The US Army now issues, for all theatres of operations, the Army Combat Uniform, which replaces the Battle Dress Uniform and the Desert Combat Uniform.  The colour scheme on these ACUs is a faded green/grey/tan pattern of random-appearing rectangular shapes.  Pocket outlines on the front of the jackets are offset from vertical, so as to present a less distinctive straight line for the eye to follow while using NVGs.  The U.S. Marine Corps also issues similar uniforms with their MARPAT pattern, the U.S. Marines considered adopting CADPAT for their new pattern, however, the Canadian government owns the copyright for the pattern which it had been developing since 1988. The Canadian government supplied information and manufacturers to help the Marines with the development of their own computer-generated digital pattern pixelated uniform. Though their uniforms are not designed to replace both woodland pattern uniforms and desert pattern, since both woodland digital and desert digital patterns are available. Similarly the US Air Force has begun fielding digital pattern uniforms to their service members, with those uniforms featuring a blue/grey/tan pattern).

Uniform of the day: The "uniform of the day," when referred to in a military sense, is the designated uniform all military personnel are required to wear on that particular day. It is often designated by the senior officer on the base.  Normally the uniform is determined by the seasons (e.g. winter blues or summer whites for Navy) however, special occasions (e.g. visiting dignitaries) or weather changes may dictate changes to the uniform of the day.  The uniform of the day instruction is broadcast over the 1MC at reveille on board U.S. Navy ships.
The "uniform of the day" may also be referred to as the "dress of the day" in some militaries.

Logistics: Mass-produced uniforms are a good way to equip thousands of soldiers quickly and efficiently. Uniforms in standard sizes and designs are also easier to replace on campaign. As an example, English levies raised for service in Ireland or the Continent during the 17th century came to be provided with clothing purchased in bulk and often of a standard colour or cut. This was however only a temporary wartime expedient and the development of uniforms as such had to wait on the formulation of a system of permanent regiments, notably by the French Monarchy (see above).

Psychological warfare: The appearance of the troops was often enhanced in some way to intimidate the enemy. The tall, mitre-shaped caps worn by grenadiers in the 18th century made their wearers appear bigger and more impressive. King Frederick William I of Prussia had a guard unit of especially tall men with tall mitre hats, the Potsdam Giants.