Railroads played a large role in the development of the United States from the Industrial Revolution in the Northeast (1820s–1850s) to the settlement of the West (1850s–1890s). The American railroad mania began with the founding of the first passenger and freight line in the country, the Baltimore and Ohio Railroad, in 1827 and the "Laying of the First Stone" ceremonies. Its long construction westward over the Appalachian Mountains began in the next year. It flourished with continuous railway building projects for the next 45 years until the financial Panic of 1873, followed by a major economic depression that bankrupted many companies and temporarily stymied growth.

Railroads increased the speed of transport and dramatically lowered its cost. In the West where navigable rivers were few, the low cost allowed shipping of primary sector products hundreds of miles at a profit. Converting the Great American Desert of the Louisiana Purchase into the American breadbasket took decades rather than centuries.Athearn, Robert G. Rebel of the Rockies: A History of the Denver and Rio Grande Western Railroad, pp. 4-5, 16-25, Yale University Press, New Haven, Connecticut, 1962.Beebe, Lucius and Clegg, Charles. Narrow Gauge in the Rockies, p. 31, Howell-North, Berkeley, California, 1958.Davidson, James West, et al. American Nation: Independence Through 1914, p. 304, Prentice-Hall, Upper Saddle River, New Jersey, 2000. .Blum, John M. et al. The National Experience: A History of the United States, pp. 298-9, Harcourt, Brace & World, Inc., New York, New York, 1963.

Though the antebellum South started early to build railways, the absence of an interconnected network was a major handicap of Confederate railroads in the American Civil War (1861–1865). Lines already linked every city in the North and Midwest before the war. In the heavily settled Midwestern Corn Belt, over 80 percent of farms were within of a railway, facilitating the shipment of grain, hogs, and cattle to national and international markets. Many shortline railroads were built, but the majority were consolidated into 20 trunk lines by 1890. State and local governments often subsidized lines but rarely owned them. The economic importance and complexity of this new national system, and failures in management, inspired the first federal regulatory agency, the Interstate Commerce Commission in the 1880s.

The system was largely built by 1910. However, federal and state policies to subsidize, fund, and prioritize new competitors against railroads resulted in decline. The large system of highways built and owned by public authorities, operating at a loss and rather than a profit, allowed trucks to eat away freight traffic. Automobiles (and later airplanes, which were also subsidized via airports, air traffic control, etc.) devoured the passenger traffic. After 1940, the replacement of steam with diesel electric locomotives made for much more efficient operations that needed fewer workers on the road and in repair shops.

A series of bankruptcies and consolidations left the rail system in the hands of a few large operations by the 1980s. Almost all long-distance passenger traffic shifted to Amtrak in 1971, a government-owned operation. Commuter rail service is provided near a few major cities, including New York City, Chicago, Boston, Philadelphia, Baltimore, and Washington, D.C. Computerization and improved equipment steadily reduced employment, which peaked at 2.1 million in 1920, falling to 1.2 million in 1950 and 215,000 in 2010. Route mileage peaked at in 1916 and fell to in 2011.

Freight railroads continue to play an important role in the United States' economy, especially for moving imports and exports using containers, and for bulk shipments of coal and (since 2010) oil. Productivity rose 172% between 1981 and 2000, while rates rose 55% (after accounting for inflation). Rail's share of the American freight market rose to 43%, the highest for any rich country, primarily due to external factors such as geography and higher use of goods like coal.Increasing EU Rail Share: Insights From the US Rail Experience See Alternate Link 7International Union of Railways "DIOMIS: Benchmarking Intermodal Rail Transport in the United States and Europe" Alternate Source for Dead Link In recent years, railroads have gradually been losing intermodal traffic to trucking.

Early period (to 1860) The animal powered Leiper Railroad followed in 1810 after the preceding successful experiment—designed and built by merchant Thomas Leiper, the railway connected Crum Creek to Ridley Creek, in Delaware County, Pennsylvania. It was used until 1829, when it was temporarily replaced by the Leiper Canal, then it was reopened to replace the canal in 1852. This was the first railroad meant to be permanent and the first to evolve into trackage of a common carrier after an intervening closure.

In 1826 Massachusetts incorporated Quincy's Granite Railway as a common freight carrierCommonwealth of Massachusetts (1826). "An Act to Incorporate the Granite Railway Company," Laws of the Commonwealth of Massachusetts. Chap. CLXXXIII. Approved March 4, 1826. to primarily haul granite for the construction of the Bunker Hill Monument; operations began later that year, and which still had a section of it operating until the 1940s.

Other railroads authorized by states in 1826 and constructed in the following years included the Delaware and Hudson Canal Company's gravity railroad; and the Mohawk and Hudson Railroad, to carry freight and passengers around a bend in the Erie Canal. To link the Port of Baltimore to the Ohio River, in 1827 Maryland chartered the Baltimore and Ohio Railroad (B&O), the first section of which opened in 1830. Similarly, the South Carolina Canal and Railroad Company was chartered in 1827 to connect Charleston to the Savannah River, and Pennsylvania built the Main Line of Public Works between Philadelphia and the Ohio River.

Steam locomotives The South Carolina Canal and Rail Road Company was the first to use steam locomotives regularly beginning with the Best Friend of Charleston, the first American-built locomotive intended for revenue service, in December 1830. The B&O started developing steam locomotives in 1829 with Peter Cooper's Tom Thumb. This was the first American-built locomotive to run in the U.S., although it was intended as a demonstration of the potential of steam traction rather than as a revenue-earning locomotive. Many of the earliest locomotives for American railroads were imported from England, including the Stourbridge Lion and the John Bull, but a domestic locomotive manufacturing industry was quickly established, with locomotives like the DeWitt Clinton being built in the 1830s.Hamilton Ellis, The Pictorial Encyclopedia of Railways. London: Hamlyn Publishing Group, 1968; pp. 24–30. The B&O's westward route reached the Ohio River in 1852, the first eastern seaboard railroad to do so.

By 1850, of railroad lines had been built.

Late 19th century

Land grants

The federal government operated a land grant system between 1855 and 1871, through which new railway companies in the west were given millions of acres they could sell to prospective farmers or pledge to bondholders. A total of were granted to the railroads before the program ended, supplemented by a further granted by the states and by various government subsidies.Paul Gates, History of Public Land Law Development (1968, government document and not copyright) online; railroad land grants on pp 341–386. This program enabled the opening of numerous western lines, especially the Union Pacific-Central Pacific with fast service from San Francisco to Omaha and east to Chicago. West of Chicago, many cities grew up as rail centers, with repair shops and a base of technically literate workers.James R. Shortridge, Cities on the plains: The evolution of urban Kansas (UP of Kansas, 2004).

In return for the land grants, the railroads were required to haul government personnel and cargo at significantly reduced rates (generally half of the normal rate). The land was granted in a checkerboard fashion, with the government retaining every other section. The land that the government retained typically doubled in value as a result of the railroad being built.Holbrook, Stewart H. The Story of American Railroads, pp. 156-7, 161-2, Bonanza Books, New York, New York, 1947.Locklin, D. Philip. Economics of Transportation, pp. 134, 136-7, Richard D. Irwin, Inc., Homewood, Illinois, 1972.

The government guaranteed loans to several Pacific railroads, which were all paid off by 1899 ($63 million in principal and $105 million in interest). After receiving rate discounts of approximately 50% on government personnel and cargo for 80 years (including during two world wars), Congress finally discontinued the rate reductions at the end of World War II. The land grants had been more than paid for (several times over).Holbrook, Stewart H. The Story of American Railroads, pp. 156-7, 161-2, Bonanza Books, New York, New York, 1947.Locklin, D. Philip. Economics of Transportation, pp. 134, 136-7, Richard D. Irwin, Inc., Homewood, Illinois, 1972.

Displacing water routes

Railroads replaced many canals and turnpikes and by the 1870s had significantly displaced steamboats as well. The railroads were superior to these alternative modes of transportation, particularly water routes because they lowered costs in two ways. Canals and rivers were unavailable in the winter season due to freezing, but the railroads ran year-round despite poor weather. And railroads were safer: the likelihood of a train crash was less than the likelihood of a boat sinking. The railroads provided cost-effective transportation because they allowed shippers to have a smaller inventory of goods, which reduced storage costs during winter, and to avoid insurance costs from the risk of losing goods during transit.

Changing style of travel Likewise, railroads changed the style of transportation. For the common person in the early 19th century, transportation was often by horse or stagecoach. The network of trails along which coaches navigated were riddled with ditches, potholes, and stones. This made travel fairly uncomfortable, and coaches were cramped with little leg room. Travel by train offered a new style. Locomotives proved themselves a smooth, headache free ride with plenty of room to move around. Some passenger trains offered meals in the spacious dining car followed by a good night sleep in the private sleeping quarters.

Networks Railroad companies in the North and Midwest constructed networks that linked nearly every major city by 1860. In the heavily settled Corn Belt (from Ohio to Iowa), over 80 percent of farms were within of a railway. A large number of short lines were built, but due to a fast-developing financial system based on Wall Street and oriented to railway securities, the majority were consolidated into 20 trunk lines by 1890. Most of these railroads made money, and ones that were unprofitable were bought up and incorporated in a larger system or "rationalized". Although the transcontinental railroads dominated the media, with the completion of the First transcontinental railroad in 1869 dramatically symbolizing the nation's unification after the divisiveness of the Civil War, most construction actually took place in the industrial Northeast and agricultural Midwest, and was designed to minimize shipping times and costs. The railroads in the South were repaired and expanded and then, after a lot of preparation, changed from a 5-foot gauge to standard gauge of 4 foot 8 ½ inches in two days in May 1886.Southern railroad gauge change accessed 13 Mar 201.