Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a question about the meta tag content-type. When starting to build my site (HTML+PHP+JS), I copied a lot of the meta tags over from elsewhere, and I have, amongst others, the following:

<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />

Now, I've seen that tag is being used a lot with the value "text/html". I've been searching the web but could not find a comprehensive explanation regarding what the difference between both is. The "text/html" intuitively sounds more straightforward to me.

Should I change my tag to that, or might the "application/xhtml+xml" be an equivalent solution ?

Alternatively, can anyone point me to a resource where the different values for these tags are listed and explained in a clear manner?

Thanks in advance

share|improve this question
up vote 6 down vote accepted

You can find the full answer here: http://www.w3.org/TR/xhtml-media-types/#intro. However in brief, application/xhtml+xml is for XHTML. That document recommends using HTML 4.01, but I recommend using HTML 5 since there is widespread support for it now. The content type for HTML 5 is

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Change the charset to whatever you're using. If you don't know or don't want to understand what you're using then just leave it as utf-8 and most things will work.

(The HTML vs XHTML debate is long and complicated, so I won't even attempt to summarise it.)

share|improve this answer
+1. The usual HTML5 way is to serve the content with an HTTP header identifying it as text/html (rather than an equivalent in the markup itself) and to use <meta charset="utf-8">. – Charles Jun 29 '11 at 15:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.