Nmap is a free and open source security scanning tool used to discover hosts and services on a computer network. It was originally written by Gordon Lyon and first published in 1997. Nmap uses raw IP packets to determine what hosts are available on the network, what services they offer, and what operating systems they are running. It has features like host discovery, port scanning, version detection, OS detection, and scriptable interaction. Nmap is commonly used for network inventory, auditing security, and identifying vulnerabilities, though some uses may be considered illegal without authorization.