Samuel Langhorne Clemens was born in Florida, Missouri, on November 30, 1835. He was the son of Jane (née Lampton; 1803–1890), a native of Kentucky, and John Marshall Clemens (1798–1847), a Virginian. His parents met when his father moved to Missouri and were married in 1823. Twain was the sixth of seven children, but only three of his siblings survived childhood: Orion (1825–1897); Henry (1838–1858); and Pamela (1827–1904). His sister Margaret (1833–1839) died when he was three, and his brother Benjamin (1832–1842) died three years later. Another brother, Pleasant (1828–1829), died at six months. Twain was born two weeks after the closest approach to Earth of Halley's Comet. His ancestors were of Scots-Irish, English, and Cornish extraction.
When he was four, Twain's family moved to Hannibal, Missouri, a port town on the Mississippi River that inspired the fictional town of St. Petersburg in The Adventures of Tom Sawyer and Adventures of Huckleberry Finn. Slavery, then legal in Missouri, was a theme Twain would explore in these writings.
In 1847, when Twain was 11, his father, by then an attorney and judge, died of pneumonia. The next year Twain left school after the fifth grade to become a printer's apprentice. In 1851, he began working as a typesetter and contributor of articles and humorous sketches for the Hannibal Journal, a newspaper Orion owned. When he was 18, he left Hannibal and worked as a printer in New York City, Philadelphia, St. Louis, and Cincinnati. He joined the newly formed International Typographical Union, the printers union, and educated himself in public libraries in the evenings, finding wider information than at a conventional school.
Twain describes in Life on the Mississippi how, when he was a boy, "there was but one permanent ambition" among his comrades: to be a steamboatman. "Pilot was the grandest position of all. The pilot, even in those days of trivial wages, had a princely salary – from a hundred and fifty to two hundred and fifty dollars a month, and no board to pay." As Twain described it, the pilot's prestige exceeded that of the captain. The pilot had to "get up a warm personal acquaintanceship with every old snag and one-limbed cottonwood and every obscure wood pile that ornaments the banks of this river for twelve hundred miles; and more than that, must ... actually know where these things are in the dark..." Steamboat pilot Horace E. Bixby took on Twain as a "cub" pilot to teach him the river between New Orleans and St. Louis for $500, payable out of Twain's first wages after graduating. Twain studied the Mississippi, learning its landmarks, how to navigate its currents effectively, and how to "read the river" and its constantly shifting channels, reefs, submerged snags and rocks that would "tear the life out of the strongest vessel that ever floated". It was more than two years before he received his pilot's license. Piloting gave him his pen name, Mark Twain, from "mark twain", the leadsman's cry for a measured river depth of two fathoms (12 feet), which was safe water for a steamboat.
While training, Samuel convinced his younger brother Henry to work with him. Henry was killed on June 21, 1858, when the steamboat he was working on, the Pennsylvania, exploded. Twain had foreseen this death in a dream a month earlier,:275 which inspired his interest in parapsychology; he was an early member of the Society for Psychical Research. Twain was guilt-stricken and held himself responsible for the rest of his life.
Twain continued to work on the river and was a river pilot until the American Civil War broke out in 1861, and traffic along the Mississippi was curtailed. At the start of hostilities, Twain enlisted briefly in a Confederate local unit. Twain later wrote a sketch, "The Private History of a Campaign That Failed", that told how he and his friends had been Confederate volunteers for two weeks before disbanding. He then left for Nevada to work for Orion, who was Secretary of the Nevada Territory. Twain describes the episode in his book Roughing It.