Plumbing is any system that conveys fluids for a wide range of applications. Plumbing uses pipes, valves, plumbing fixtures, tanks, and other apparatuses to convey fluids.  Heating and cooling (HVAC), waste removal, and potable water delivery are among the most common uses for plumbing, but it is not limited to these applications.  The word derives from the Latin for lead, plumbum, as the first effective pipes used in the Roman era were lead pipes.
 In the developed world, plumbing infrastructure is critical to public health and sanitation.
 Boilermakers and pipefitters are not plumbers although they work with piping as part of their trade and their work can include some plumbing.
 Plumbing originated during ancient civilizations, as they developed public baths and needed to provide potable water and wastewater removal for larger numbers of people.
 The Mesopotamians introduced the world to clay sewer pipes around 4000 BCE, with the earliest examples found in the Temple of Bel at Nippur and at Eshnunna, used to remove wastewater from sites, and capture rainwater, in wells. The city of Uruk contains the oldest known examples of brick constructed Latrines, constructed atop interconnecting fired clay sewer pipes, c. 3200 BCE. Clay pipes were later used in the Hittite city of Hattusa. They had easily detachable and replaceable segments, and allowed for cleaning.
 Standardized earthen plumbing pipes with broad flanges making use of asphalt for preventing leakages appeared in the urban settlements of the Indus Valley civilization by 2700 BC.
 Copper piping appeared in Egypt by 2400 BCE, with the Pyramid of Sahure and adjoining temple complex at Abusir, found to be connected by a copper waste pipe.
 The word  "plumber" dates from the Roman Empire. The Latin for lead is plumbum.  Roman roofs used lead in conduits and drain pipes and some were also covered with lead. Lead was also used for piping and for making baths.
 Plumbing reached its early apex in ancient Rome, which saw the introduction of expansive systems of aqueducts, tile wastewater removal, and widespread use of lead pipes. The Romans used lead pipe inscriptions to prevent water theft. With the Fall of Rome both water supply and sanitation stagnated—or regressed—for well over 1,000 years.  Improvement was very slow, with little effective progress made until the growth of modern densely populated cities in the 1800s. During this period, public health authorities began pressing for better waste disposal systems to be installed, to prevent or control epidemics of disease. Earlier, the waste disposal system had consisted of collecting waste and dumping it on the ground or into a river. Eventually the development of separate, underground water and sewage systems eliminated open sewage ditches and cesspools.
 In post-classical Kilwa the wealthy enjoyed indoor plumbing in their stone homes.
 Most large cities today pipe solid wastes to sewage treatment plants in order to separate and partially purify the water, before emptying into streams or other bodies of water. For potable water use, galvanized iron piping was commonplace in the United States from the late 1800s until around 1960. After that period, copper piping took over, first soft copper with flared fittings, then with rigid copper tubing using soldered fittings.
 The use of lead for potable water declined sharply after World War II because of increased awareness of the dangers of lead poisoning. At this time, copper piping was introduced as a better and safer alternative to lead pipes.
 The major categories of plumbing systems or subsystems are:
 A water pipe is a pipe or tube, frequently made of plastic or metal, that carries pressurized and treated fresh water to a building (as part of a municipal water system), as well as inside the building.
 Lead was the favoured material for water pipes for many centuries because its malleability made it practical to work into the desired shape. Such use was so common that the word "plumbing" derives from plumbum, the Latin word for lead. This was a source of lead-related health problems in the years before the health hazards of ingesting lead were fully understood; among these were stillbirths and high rates of infant mortality. Lead water pipes were still widely used in the early 20th century and remain in many households. Lead-tin alloy solder was commonly used to join copper pipes, but modern practice uses tin-antimony alloy solder instead in order to eliminate lead hazards.
 Despite the Romans' common use of lead pipes, their aqueducts rarely poisoned people. Unlike other parts of the world where lead pipes cause poisoning, the Roman water had so much calcium in it that a layer of plaque prevented the water contacting the lead itself. What often causes confusion is the large amount of evidence of widespread lead poisoning, particularly amongst those who would have had easy access to piped water, an unfortunate result of lead being used in cookware and as an additive to processed food and drink (for example as a preservative in wine). Roman lead pipe inscriptions provided information on the owner to prevent water theft.
 Wooden pipes were used in London and elsewhere during the 16th and 17th centuries. The pipes were hollowed-out logs which were tapered at the end with a small hole in which the water would pass through. The multiple pipes were then sealed together with hot animal fat. Wooden pipes were  used in Philadelphia, Boston, and Montreal in the 1800s. Built-up wooden tubes were widely used in the US during the 20th century. These pipes (used in place of corrugated iron or reinforced concrete pipes) were made of sections cut from short lengths of wood. Locking of adjacent rings with hardwood dowel pins produced a flexible structure. About 100,000 feet of these wooden pipes were installed during WW2 in drainage culverts, storm sewers and conduits, under highways and at army camps, naval stations, airfields and ordnance plants.
 Cast iron and ductile iron pipe was long a lower-cost alternative to copper before the advent of durable plastic materials but special non-conductive fittings must be used where transitions are to be made to other metallic pipes (except for terminal fittings) in order to avoid corrosion owing to electrochemical reactions between dissimilar metals (see galvanic cell).
 Bronze fittings and short pipe segments are commonly used in combination with various materials.
 The difference between pipes and tubes is a matter of sizing. For instance, PVC pipe for plumbing applications and galvanized steel pipe are measured in iron pipe size (IPS). Copper tube, CPVC, PeX and other tubing is measured nominally, basically an average diameter. These sizing schemes allow for universal adaptation of transitional fittings. For instance, 1/2" PeX tubing is the same size as 1/2" copper tubing. 1/2" PVC on the other hand is not the same size as 1/2" tubing, and therefore requires either a threaded male or female adapter to connect them.  When used in agricultural irrigation, the singular form "pipe" is often used as a plural.
 Pipe is available in rigid joints, which come in various lengths depending on the material. Tubing, in particular copper, comes in rigid hard tempered joints or soft tempered (annealed) rolls. PeX and CPVC tubing also comes in rigid joints or flexible rolls. The temper of the copper, whether it is a rigid joint or flexible roll, does not affect the sizing.
 The thicknesses of the water pipe and tube walls can vary. Because piping and tubing are commodities, having a greater wall thickness implies higher initial cost. Thicker walled pipe generally implies greater durability and higher pressure tolerances. Pipe wall thickness is denoted by various schedules or for large bore polyethylene pipe in the UK by the Standard Dimension Ratio (SDR), defined as the ratio of the pipe diameter to its wall thickness. Pipe wall thickness increases with schedule, and is available in schedules 20, 40, 80, and higher in special cases. The schedule is largely determined by the operating pressure of the system, with higher pressures commanding greater thickness. Copper tubing is available in four wall thicknesses: type DWV (thinnest wall; only allowed as drain pipe per UPC), type 'M' (thin; typically only allowed as drain pipe by IPC code), type 'L' (thicker, standard duty for water lines and water service), and type 'K' (thickest, typically used underground between the main and the meter).
 Wall thickness does not affect pipe or tubing size. 1/2" L copper has the same outer diameter as 1/2" K or M copper. The same applies to pipe schedules. As a result, a slight increase in pressure losses is realized due to a decrease in flowpath as wall thickness is increased. In other words, 1 foot of 1/2" L copper has slightly less volume than 1 foot of 1/2 M copper.
 Water systems of ancient times relied on gravity for the supply of water, using pipes or channels usually made of clay, lead, bamboo, wood, or stone. Hollowed wooden logs wrapped in steel banding were used for plumbing pipes, particularly water mains. Logs were used for water distribution in England close to 500 years ago. US cities began using hollowed logs in the late 1700s through the 1800s.  Today, most plumbing supply pipe is made out of steel, copper, and plastic; most waste (also known as "soil") out of steel, copper, plastic, and cast iron.
 The straight sections of plumbing systems are called "pipes" or "tubes". A pipe is typically formed via casting or welding, whereas a tube is made through extrusion. Pipe normally has thicker walls and may be threaded or welded, while tubing is thinner-walled and requires special joining techniques such as brazing, compression fitting, crimping, or for plastics, solvent welding.  These joining techniques are discussed in more detail in the piping and plumbing fittings article.
 Galvanized steel potable water supply and distribution pipes are commonly found with nominal pipe sizes from 3⁄8 inch (9.5 mm) to 2 inches (51 mm). It is rarely used today for new construction residential plumbing. Steel pipe has National Pipe Thread (NPT) standard tapered male threads, which connect with female tapered threads on elbows, tees, couplers, valves, and other fittings. Galvanized steel (often known simply as "galv" or "iron" in the plumbing trade) is relatively expensive, and difficult to work with due to weight and requirement of a pipe threader. It remains in common use for repair of existing "galv" systems and to satisfy building code non-combustibility requirements typically found in hotels, apartment buildings and other commercial applications. It is also extremely durable and resistant to mechanical abuse.  Black lacquered steel pipe is the most widely used pipe material for fire sprinklers and natural gas.
 Most typical single family home systems won't require supply piping larger than 3⁄4 inch (19 mm) due to expense as well as steel piping's tendency to become obstructed from internal rusting and mineral deposits forming on the inside of the pipe over time once the internal galvanizing zinc coating has degraded. In potable water distribution service, galvanized steel pipe has a service life of about 30 to 50 years, although it is not uncommon for it to be less in geographic areas with corrosive water contaminants.
 Copper pipe and tubing was widely used for domestic water systems in the latter half of the twentieth century. Demand for copper products has fallen due to the dramatic increase in the price of copper, resulting in increased demand for alternative products including PEX and stainless steel.
 Plastic pipe is in wide use for domestic water supply and drain-waste-vent (DWV) pipe. Principal types include:
Polyvinyl chloride (PVC) was produced experimentally in the 19th century but did not become practical to manufacture until 1926, when Waldo Semon of BF Goodrich Co. developed a method to plasticize PVC, making it easier to process. PVC pipe began to be manufactured in the 1940s and was in wide use for Drain-Waste-Vent piping during the reconstruction of Germany and Japan following WWII. In the 1950s, plastics manufacturers in Western Europe and Japan began producing acrylonitrile butadiene styrene (ABS) pipe. The method for producing cross-linked polyethylene (PEX) was also developed in the 1950s. Plastic supply pipes have become increasingly common, with a variety of materials and fittings employed.
 Present-day water-supply systems use a network of high-pressure pumps, and pipes in buildings are now made of copper, brass, plastic (particularly cross-linked polyethylene called PEX, which is estimated to be used in 60% of single-family homes), or other nontoxic material. Due to its toxicity, most cities moved away from lead water-supply piping by the 1920s in the United States, although lead pipes were approved by national plumbing codes into the 1980s, and lead was used in plumbing solder for drinking water until it was banned in 1986. Drain and vent lines are made of plastic, steel, cast iron, or lead.
 In addition to lengths of pipe or tubing, pipe fittings such as valves, elbows, tees, and unions. are used in plumbing systems. Pipe and fittings are held in place with pipe hangers and strapping.
 Plumbing fixtures are exchangeable devices that use water and can be connected to a building's plumbing system. They are considered to be "fixtures", in that they are semi-permanent parts of buildings, not usually owned or maintained separately.  Plumbing fixtures are seen by and designed for the end-users. Some examples of fixtures include water closets (also known as toilets), urinals, bidets, showers, bathtubs, utility and kitchen sinks, drinking fountains, ice makers, humidifiers, air washers, fountains, and eye wash stations.
 Threaded pipe joints are sealed with thread seal tape or pipe dope. Many plumbing fixtures are sealed to their mounting surfaces with plumber's putty.
 Plumbing equipment includes devices often  behind walls or in utility spaces which are not seen by the general public. It includes water meters, pumps, expansion tanks, back flow preventers, water filters, UV sterilization lights, water softeners, water heaters, heat exchangers, gauges, and control systems.
 There are many tools a plumber needs to do a good plumbing job. While many simple plumbing tasks can be completed with a few common hand held tools, other more complex jobs require specialised tools, designed specifically to make the job easier.
 Specialized plumbing tools include pipe wrenches, flaring pliers, pipe vise, pipe bending machine, pipe cutter, dies, and joining tools such as soldering torches and crimp tools. New tools have been developed to help plumbers fix problems more efficiently. For example, plumbers use video cameras for inspections of hidden leaks or other problems; they also use hydro jets, and high pressure hydraulic pumps connected to steel cables for trench-less sewer line replacement.
 Flooding from excessive rain or clogged sewers may require specialized equipment, such as a heavy duty pumper truck designed to vacuum raw sewage.[citation needed]
 Bacteria have been shown to live in "premises plumbing systems". The latter refers to the "pipes and fixtures within a building that transport water to taps after it is delivered by the utility". Community water systems have been known for centuries to spread waterborne diseases like typhoid and cholera.  However, "opportunistic premises plumbing pathogens" have been recognized only more recently: Legionella pneumophila, discovered in 1976, Mycobacterium avium, and Pseudomonas aeruginosa are the most commonly tracked bacteria, which people with depressed immunity can inhale or ingest and may become infected with.
Some of the locations where these opportunistic pathogens can grow include faucets, shower heads, water heaters and along pipe walls. Reasons that favor their growth are "high surface-to-volume ratio, intermittent stagnation, low disinfectant residual, and warming cycles". A high surface-to-volume ratio, i.e. a relatively large surface area allows the bacteria to form a biofilm, which protects them from disinfection.
 Much of the plumbing work in populated areas is regulated by government or quasi-government agencies due to the direct impact on the public's health, safety, and welfare. Plumbing installation and repair work on residences and other buildings generally must be done according to plumbing and building codes to protect the inhabitants of the buildings and to ensure safe, quality construction to future buyers. If permits are required for work, plumbing contractors typically secure them from the authorities on behalf of home or building owners.[citation needed]
 In Australia, the national governing body for plumbing regulation is the Australian Building Codes Board. They are responsible for the creation of the National Construction Code (NCC), Volume 3 of which, the Plumbing Regulations 2008 and the Plumbing Code of Australia, pertains to plumbing.
 Each Government at the state level has their own Authority and regulations in place for licensing plumbers. They are also responsible for the interpretation, administration and enforcement of the regulations outlined in the NCC. These Authorities are usually established for the sole purpose of regulating plumbing activities in their respective states/territories. However, several state level regulation acts are quite outdated, with some still operating on local policies introduced more than a decade ago. This has led to an increase in plumbing regulatory issues not covered under current policy, and as such, many policies are currently being updated to cover these more modern issues. The updates include changed to the minimum experience and training requirements for licensing, additional work standards for new and more specific kinds of plumbing, as well as adopting the Plumbing Code of Australia into state regulations in an effort to standardise plumbing regulations across the country.
 In Norway, new domestic plumbing installed since 1997 has had to satisfy the requirement that it should be easily accessible for replacement after installation. This has led to the development of the pipe-in-pipe system as a de facto requirement for domestic plumbing.
 In the United Kingdom the professional body is the Chartered Institute of Plumbing and Heating Engineering (educational charity status) and it is true that the trade still remains virtually ungoverned; there are no systems in place to monitor or control the activities of unqualified plumbers or those home owners who choose to undertake installation and maintenance works themselves, despite the health and safety issues which arise from such works when they are undertaken incorrectly; see Health Aspects of Plumbing (HAP) published jointly by the World Health Organization (WHO) and the World Plumbing Council (WPC). WPC has subsequently appointed a representative to the World Health Organization to take forward various projects related to Health Aspects of Plumbing.
 In the United States, plumbing codes and licensing are generally controlled by state and local governments. At the national level, the Environmental Protection Agency has set guidelines about what constitutes lead-free plumbing fittings and pipes, in order to comply with the Safe Drinking Water Act.
 Some widely used Standards in the United States are:[citation needed]
 In Canada, plumbing is a regulated trade requiring specific technical training and certification. Standards and regulations for plumbing are overseen at the provincial and territorial level, each having its distinct governing body: