Indicates the media type of the response that is being sent.
This header tells the client what type of content is being returned. A web page typically has a value of
text/html; charset=UTF-8 which tells the browser that this is HTML and the character encoding is UTF-8. This is the recommended value for most web pages.
Every different type of content has it's own Content-Type header. Typically, the web server sends the appropriate header by inspecting the file extension. For example, an image with the name of "image.png" will get the header automatically set to
image/png and a CSS document called "styles.css" would get a value of
Your web server may not be configured to recognize certain file extensions, so you may need to configure it to do so. Additionally, a web application may dynamically generate images or other types of content, so the application will need to set the appropriate Content-Type header during runtime.
For more information, please read the documentation on MDN Web Docs.
Ready to validate your website to check for this header and 100+ others important tests?