Only three of his siblings survived childhood: his brothers Orion (July 17, 1825 - December 11, 1897) and Henry (July 13, 1838 - June 21, 1858) and his sister Pamela (September 19, 1827 - August 31, 1904). His sister Margaret (May 31, 1830 - August 17, 1839) died when Twain was four years old, and his brother Benjamin (June 8, 1832 - May 12, 1842) died three years later. Another brother, Pleasant (1828-1829), died at the age of six months. He was born two weeks after the closest approach to Earth of Halley's Comet.

When Twain was four, his family moved to Hannibal, a port town on the Mississippi River that would serve as the inspiration for the fictional town of St. Petersburg in The Adventures of Tom Sawyer and Adventures of Huckleberry Finn. At that time, Missouri was a slave state in the Union, and young Twain became familiar with the institution of slavery, a theme he later explored in his writing.

In March 1847, when Twain was 11, his father died of pneumonia. The following year, he became 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 owned by his brother, Orion. When he was 18, he left Hannibal and worked as a printer in New York City, Philadelphia, St. Louis and Cincinnati. He joined the union and educated himself in public libraries in the evenings, finding wider sources of information than he would have at a conventional school. At 22, Twain returned to Missouri. On a voyage to New Orleans down the Mississippi, the steamboat pilot, Horace E. Bixby, inspired Twain to likewise pursue a career as a steamboat pilot; it was a richly rewarding occupation with wages set at $250 per month, equivalent to $155,000 a year today.