Since it's only when coasting, it's some kind of freewheel noise. Depending on whether it was always this way, came on slowly or suddenly, or other info, it could be inherent to your freehub (some sound like buzzsaws), lack or lube, or rust ot other issues within the freehub, or much simpler something would up against the hub behind the cassette causing noise or drag when they don't turn together.
If this bike isn't new and the noise is, look behind the cassette, and/or remove the cassette and clean there before taking th ehub apart looking for an internal problem. Once the cassette is off you can test off the bike spinning the wheel while holding the freehub body.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.