A headless browser is a web browser without a user interface. Headless browsers perform all the normal functions of a web page, such as clicking links, navigating pages, downloading and uploading a document, etc but they are executed via a command-line interface or using network communication.
Headless browsers are particularly useful for testing web pages as they are able to render and understand HTML the same way a browser would, including styling elements such as page layout, color, font selection and execution of JavaScript and Ajax which are usually not available when using other testing methods.