macOS (tested on 10.11.6):
sudo lsof -i :80
…where ’80’ is the port you’re curious about (substitute any value)
Thanks to Databasically.
Windows (tested on 10 Pro version 1709):
…this will produce a list of ports in use and the PIDs using them)
Thanks to @RickVanover.