Dev Practical

Are HTML tags case sensitive?

No. HTML tags are not case sensitive. You can write all HTML tags in lowercase or uppercase and they will be correctly rendered on a browser. This means that <h1>lowercase</h1> and <H1>UPPERCASE</H1> will work on any browser.

HTML uppercase or lowercase visualization

Does case matter in HTML?

It does not matter which case you use. HTML can be uppercase, lowercase, mixed case or lowercase. However there are a few exceptions.

WHATWG a body that works on improving the current version of HTML states:

’ Many strings in the HTML syntax (e.g. the names of elements and their attributes) are case-insensitive, but only for ASCII upper alphas and ASCII lower alphas. For convenience, in this section this is just referred to as “case-insensitive”.’

Some of the places where case matters is some HTML entities that are used to display non-keyboard characters. e.g. To display uppercase Ñ  you need to use the entity with an uppercase:  &Ntilde; and a lowercase ñ you use lowercase entity &ntilde;.

HTML Case recommendation

  1. It is generally recommended that you use lowercase in HTML. I think its also easier to write HTML in lowercase as long as you are typing your sentences in lowercase.

  2. If you click on inspect on a page written in uppercase HTML code, you will find that the browser seems to have converted all the tags to lowercase.

Source:

  1. HTML entities - DevPractical
  2. HTML case - WHATWG