HTML comments are used to add notes, explanations, or reminders within your HTML code. They are not displayed on the webpage and are only visible in the source code.