An HTML document is a file containing Hypertext Markup Language, and its filename most often ends in the . HTML extension. An HTML document is a text document read in by a Web browser and then rendered on the screen. An HTML document has two* main parts: head. The head element contains title and metadata of a web document. body. HTML is used to create electronic documents (called pages) that are displayed on the World Wide Web.