Yes, chocolate is perfectly safe to eat.
This grayish or white coating is not mold, but a natural phenomenon called chocolate mold. Chocolate contains very little water, so mold (which would usually be greenish, gray, and hairy) rarely forms on it.
Although the coating changes the appearance of the chocolate and sometimes its texture (it can become drier or slightly grainy), it is harmless. There are two types of this phenomenon, depending on the cause:
Fat mold
Origin: When chocolate is exposed to temperature fluctuations (for example, when it softens slightly in the summer and then hardens again), the cocoa butter separates from the other ingredients, rises to the surface, and recrystallizes there.
Identification: It is slightly oily to the touch and can be easily spread or melted under a warm finger.
Sugar coating
Causes: When chocolate is stored in a humid environment (e.g., in the refrigerator) or condensation forms on it, water dissolves the sugar on the surface. When the water evaporates, fine sugar crystals remain.
Identification: The coating is rather dry, dull, and may be slightly crunchy or rough on the tongue.
What to do with this chocolate?
If you don’t like the slightly changed texture when you bite into it, don’t throw it away. It’s great for baking and cooking.
Melting: Use it in cake batters, cookies, or brownies.
Making the glaze: After melting and re-stirring (or tempering), the fat and sugar combine again and the white coating disappears.
Making hot chocolate: Grate the chocolate into the warm milk.