Soap :
When oils or fats are boiled with an aqueous solution of sodium hydroxide or potassium hydroxide, sodium salt or potassium salt of the carboxylic acid is obtained. These salts are known as soap.
Detergent :
A substance either in powder or liquid form used to remove dirt from clothes is called a detergent. Detergent is a long chain of the sodium salt of alkyl benzene sulphonic acid or sodium salt of alkyl hydrogen sulphate.