Uncle Sam (initials U.S.) is a common national personification of the American government or the United States in general that, according to legend, came into use during the War of 1812 and was supposedly named for Samuel Wilson. The actual origin is by a legend.  Since the early 19th century, Uncle Sam has been a popular symbol of the US government in American culture and a manifestation of patriotic emotion.  While the figure of Uncle Sam represents specifically the government, Columbia represents the United States as a nation.
The first reference to Uncle Sam in formal literature (as distinct from newspapers) was in the 1816 allegorical book The Adventures of Uncle Sam, in Search After His Lost Honor by Frederick Augustus Fidfaddy, Esq.  Other possible references date to the American Revolutionary War: an Uncle Sam is mentioned as early as 1775, in the original lyrics of " Yankee Doodle",  though it is not clear whether this reference is to Uncle Sam as a metaphor for the United States, or to an actual person named Sam. The lyrics as a whole celebrate the military efforts of the young nation in besieging the British at Boston. The 13th stanza is:
Old Uncle Sam come there to change
Some pancakes and some onions,
For 'lasses cakes, to carry home
To give his wife and young ones. 
The earliest known personification of the United States was as a woman named Columbia, who first appeared in 1738 (pre-USA) and sometimes was associated with another female personification, Lady Liberty. With the American Revolutionary War came Brother Jonathan, a male personification, and Uncle Sam finally appeared after the War of 1812.  Columbia appeared with either Brother Jonathan or Uncle Sam, but her use declined as a national personification in favor of Liberty, and she was effectively abandoned once she became the mascot of Columbia Pictures in the 1920s.
According to an article in the 1893 The Lutheran Witness, Uncle Sam was simply another name for Brother Jonathan:
When we meet him in politics we call him Uncle Sam; when we meet him in society we call him Brother Jonathan. Here of late Uncle Sam alias Brother Jonathan has been doing a powerful lot of complaining, hardly doing anything else. [sic] 
A March 24, 1810 journal entry by Isaac Mayo states:
weighed anchor stood down the harbour, passed Sandy Hook, where there are two light-houses, and put to sea, first and second day out most deadly seasick, oh could I have got on shore in the hight [sic] of it, I swear that uncle Sam, as they call him, would certainly forever have lost the services of at least one sailor. 
The precise origin of the Uncle Sam character is unclear, but a popular legend is that the name "Uncle Sam" was derived from Samuel Wilson, a meatpacker from Troy, New York who supplied rations for American soldiers during the War of 1812. There was a requirement at the time for contractors to stamp their name and where the rations came from onto the food they were sending. Wilson's packages were labeled "E.A – US." When someone asked what that stood for, a co-worker jokingly said, "Elbert Anderson [the contractor] and Uncle Sam," referring to Wilson, though the "US" actually stood for United States.  Doubts have been raised as to the authenticity of this story, as the claim did not appear in print until 1842.  Additionally, the earliest known mention definitely referring to the metaphorical Uncle Sam is from 1810, predating Wilson's contract with the government.  As early as 1835, Brother Jonathan made a reference to Uncle Sam, implying that they symbolized different things: Brother Jonathan was the country itself, while Uncle Sam was the government and its power. 
By the 1850s, the names Brother Jonathan and Uncle Sam were being used nearly interchangeably, to the point that images of what had previously been called "Brother Jonathan" were being called "Uncle Sam". Similarly, the appearance of both personifications varied wildly. For example, one depiction of Uncle Sam in 1860 showed him looking like Benjamin Franklin,  while a contemporaneous depiction of Brother Jonathan  looks more like the modern version of Uncle Sam, though without a goatee.
Uncle Sam did not get a standard appearance, even with the effective abandonment of Brother Jonathan near the end of the American Civil War, until the well-known "recruitment" image of Uncle Sam was first created by James Montgomery Flagg during World War I. The image was inspired by a British recruitment poster showing Lord Kitchener in a similar pose. It is this image more than any other that has influenced the modern appearance of Uncle Sam: an elderly white man with white hair and a goatee, wearing a white top hat with white stars on a blue band, a blue tail coat, and red-and-white-striped trousers.
Flagg's depiction of Uncle Sam was shown publicly for the first time, according to some, on the cover of the magazine Leslie's Weekly on July 6, 1916, with the caption "What Are You Doing for Preparedness?"   More than four million copies of this image were printed between 1917 and 1918. Flagg's image was also used extensively during World War II, during which the U.S. was codenamed "Samland" by the German intelligence agency Abwehr.  The term was central in the song " The Yankee Doodle Boy", which was featured in 1942 in the musical Yankee Doodle Dandy.
There are two memorials to Uncle Sam, both of which commemorate the life of Samuel Wilson: the Uncle Sam Memorial Statue in Arlington, Massachusetts, his birthplace; and a memorial near his long-term residence in Riverfront Park, Troy, New York. Wilson's boyhood home can still be visited in Mason, New Hampshire. Samuel Wilson died on July 31, 1854, aged 87, and is buried in Oakwood Cemetery, Troy, New York.
In 1989, "Uncle Sam Day" became official. A Congressional joint resolution  designated September 13, 1989 as "Uncle Sam Day", the birthday of Samuel Wilson. In 2015, the family history company MyHeritage researched Uncle Sam's family tree and claims to have tracked down his living relatives.  
- "The Most Famous Poster". American Treasures of the Library of Congress. Archived from the original on 2016-07-02.
- Walter Botts, the Man Who Modeled Uncle Sam's Pose for J.M. Flagg's Famous Poster
- Schauffler, Robert Haven (1912). Flag day; its history. p. 145.
- Terry Allan Hicks.
Uncle Sam. Marshall Cavendish 2006, 40 pages,
0761421378. Retrieved 2015-08-01. templatestyles stripmarker in
|publisher=at position 36 ( help)(p.9)
- p. 40–41 of Albert Matthews, "Uncle Sam". Proceedings of the American Antiquarian Society, v.19, 1908. pp.21–65. Google Books
- Benson J. Lossing, Pictorial Field Book of the Revolution, Volume II, Supplement XIV (1850)
- Aldrich, Mark (2004). A Catalog of Folk Song Settings for Wind Band. Hal Leonard Corporation. pp. 33, 59.
- "Uncle Sam,". Encyclopædia Britannica Online. Retrieved 9 June 2012.
- December 7, 1893 "A Bit of Advice" The Lutheran Witness pg 100
- Zimmer, Ben (July 4, 2013). "New Light on "Uncle Sam" referencing work at USS Constitution Museum in Charlestown, Mass".
- Wyandott Herald, Kansas City, August 17, 1882, p. 2
- Matthews, Albert (1908). "Uncle Sam". Proceedings of the American Antiquarian Society, Volume 19.
- Morgan, Winifred (1988). An American icon: Brother Jonathan and American identity. University of Delaware Press. pg. 81.
- An appearance echoed in Harper's Weekly, June 3, 1865 "Checkmate" political cartoon (Morgan, Winifred (1988) An American icon: Brother Jonathan and American identity University of Delaware Press pg 95)
- On page 32 of the January 11, 1862 edition Harper's Weekly.
- "Who Created Uncle Sam?". Life's Little Mysteries. Live Science. Archived from the original on December 3, 2008. Retrieved February 16, 2012.
- Macintyre, Ben. Operation Mincemeat, p.57. ISBN 978-1-4088-0921-1
- "Bill Summary & Status - 100th Congress (1987 - 1988) - H.J.RES.626 - All Congressional Actions - THOMAS (Library of Congress)". loc.gov.
- "New York Butcher is Named as Real Live Uncle Sam". New York Times. 2015-07-03. Retrieved 2015-07-03.
- "The History Behind Uncle Sam's Family Tree". Fox News. 2015-07-03. Retrieved 2015-07-03.
- Mouraux, Cecile, and Jean-Pierre Mouraux. Who Was "Uncle Sam": Illustrated Story of the Life of Our National Symbol. Sonoma, CA: Poster Collector, 2006. OCLC 70129530
|Wikimedia Commons has media related to Uncle Sam.|
- Uncle Sam: The man and the meme by Natalie Elder (National Museum of American History)
- Historical Uncle Sam pictures
- James Montgomery Flagg's 1917 "I Want You" Poster and other works at the Wayback Machine (archived October 28, 2004)
- What's the origin of Uncle Sam? The Straight Dope
- Civil War Harper's Weekly newspapers