The uniform’s main purpose was to create a clear distinction between the upper and lower classes onboard ship, so it wasn’t hugely important for all the officers to wear precisely the same thing — just for them to represent the officer class in a respectable manner. The basics of a Naval officer’s uniform were a navy blue coat, white breeches or trousers, a white shirt, and a waistcoat. Within those parameters, you can already see a fair amount of variety among the officer characters in Master & Commander. It’s closer to a strict office dresscode than a modern-day military uniform — as in, you have to wear a sombre suit, but your boss doesn’t tell you what colour of tie to wear. If you look at the officers onboard the HMS Surprise, you can tell they’re wearing near-identical coats and other “uniform” items, but their waistcoats, shirts and cravats are often different, as are the styles in which they wear them. The standards were more exacting when it came to dress-uniform occasions but for everyday wear, officers had a certain amount of leeway.
Military uniforms in the early 19th century were closely tied to current fashions and images of masculinity, so it’s not surprising that the uniform guidelines were so malleable. Not only was there a certain amount of fashion-based posturing among officers in real life, but there was also a generational divide — one that we see quite clearly in this film. Captain Aubrey, a traditionalist in early middle-age, represents the old guard in canvas knee-breeches and long hair. But the teenaged midshipmen look more like Victorians in terms of style, with short hair and long trousers. The enlisted men wear what were known as “slops” — non-uniform clothing that was generally bought either from the ship’s stores or at the docks when the ship was berthed. Enlisted/pressganged men often made and mended their clothes themselves, whereas the officers, as Gentlemen, were expected to pay for their uniforms to be made from scratch. Since mass-production wasn’t yet an option, the officers would have their uniforms tailored professionally, which further adds to the lack of uniformity among the ranks. Aubrey is probably wearing the same coat he’s had for years, whereas a younger officer’s coat would be tailored to a more modern style.
One of the things that makes this movie seem so true to the period is the widespread grime and the characters’ attitude towards it. This was the beginning of the “cleanliness is next to godliness” era, with a great deal of pressure being put upon people to look smart and therefore “civilised”. There are several scenes where Midshipmen are told to smarten up or Aubrey references the importance of neatness and efficiency to a British Navy vessel, but to a modern eye everything still looks filthy. Maintaining an image of British aristocracy and cleanliness is no picnic when you have a full-time manual job sailing an 18th-century frigate, and have relatively little fresh water or, indeed, soap.