Detergents are ammonium or sulphonate salts of long chain carboxylic acids. Unlike soap, they do not react with calcium and magnesium ions present in hard water to form scum. They give a good amount of lather irrespective of whether the water is hard or soft. This means that detergents can be used in both soft and hard water. Therefore, it cannot be used to check whether the water is hard or not.