Those groups have been pressing the company to remove two cancer-causing chemicals: 1,4-dioxane, considered a likely carcinogen, and quaternium-15, a chemical that releases the preservative formaldehyde.
They want the chemicals out of products, including the signature baby shampoo, long advertised under the slogan "No More Tears."
Johnson & Johnson said the chemicals will be removed within two years and sooner for the baby products.
The company said some products already have versions with alternative preservatives.