A detergent is a surfactant
Surfactants are compounds that lower the surface tension of a liquid, the interfacial tension between two liquids, or that between a liquid and a solid...

 or a mixture of surfactants with "cleaning properties in dilute solutions." In common usage, "detergent" refers to alkylbenzenesulfonates, a family of compounds that are similar to soap
In chemistry, soap is a salt of a fatty acid.IUPAC. "" Compendium of Chemical Terminology, 2nd ed. . Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford . XML on-line corrected version: created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN...

 but are less affected by hard water
Hard water
Hard water is water that has high mineral content . Hard water has high concentrations of Ca2+ and Mg2+ ions. Hard water is generally not harmful to one's health but can pose serious problems in industrial settings, where water hardness is monitored to avoid costly breakdowns in boilers, cooling...

. In most household contexts, the term detergent by itself refers specifically to laundry detergent
Laundry detergent
Laundry detergent, or washing powder, is a substance that is a type of detergent that is added for cleaning laundry. In common usage, "detergent" refers to mixtures of chemical compounds including alkylbenzenesulfonates, which are similar to soap but are less affected by "hard water." In most...

or dish detergent, as opposed to hand soap or other types of cleaning agents.