Ellagic acid is a naturally occurring substance. The best sources of ellagic acid in the diet are strawberries, raspberries, blackberries, and walnuts. Medicinally, ellagic acid is used to prevent cancer and treat viral and bacterial infections. Ellagic acid may bind to chemicals that cause cancer, and it may also prevent the growth of cancer cells.