Q. The mahogany decking we installed on a house last year has developed some dark staining around the stainless steel nail heads (see photo). The staining is worse on the front porch, which is covered, and not nearly as bad on the back deck, which receives full sun. What’s causing it?

A. Bill Feist, a former wood-finishes researcher with the Forest Products Laboratory in Madison, Wis., responds: There are many different species and subspecies of mahogany, with varying properties, so it’s difficult to pinpoint your problem. But the staining is mostly likely due to mildew, iron in the nails, or extractives in the wood.

Mildew. A form of stain fungi, mildew is probably the most common cause of wood and house-paint discoloration. To test for the presence of mildew on wood, apply a drop or two of liquid household bleach (5 percent sodium hypochlorite) to the stain. The dark color of mildew will usually bleach out in one or two minutes — though my guess is that this is not a mildew problem. If it is, scrubbing the wood with a solution of one quart of bleach in a gallon of water — followed by a clear-water rinse — should remove the stains.

Iron staining. Low-quality stainless steel nails, and even the wire used to collate pneumatic-gun nails, can cause staining. There is a simple test you can use to see if the staining on the wood deck comes from iron contamination: Apply a saturated solution of oxalic acid (typically used for bleaching wood, especially oak) in warm water; if iron is the source of the contamination, this solution will remove the gray or black stains in a few minutes. If that is what happens, brush the oxalic acid solution on the affected areas and then on the entire deck. After the wood has dried, rinse the deck thoroughly with clear water.

Water-soluble wood extractives. In some tree species — including American or true mahogany, African mahogany, and Philippine mahogany (meranti or lauan) — the heartwood contains water-soluble extractives that give the wood its attractive color. If exposed to enough moisture, these extractives can dissolve and migrate to the surface of the wood, leading to staining. Meanwhile, nails and screws that penetrate wood expose end-grain along the shank of the fastener. Because water enters and evaporates from end-grain so readily, areas around the nail heads would have higher concentrations of the extractives, leading to staining and discoloration. These extractives are light-sensitive, often darkening initially, then bleaching out with prolonged sun exposure. If extractives are your culprit, washing the decking with an oxalic-acid solution as described above might be all that’s needed to fix the problem.