I'm not sure why people feel the need to capitalize DOCTYPE - the spec allows <!doctype html>. (Here's the exact text from the spec: '1. A string that is an ASCII case-insensitive match for the string "<!DOCTYPE"....')
While we're on the subject of pedantry:
1) Given the unclear use of "smallest", !doctype is smaller, because lowercase letters are smaller than uppercase letters.
2) Your newlines unnecessarily add two extra characters to the page (arguably three if you count the newline after the title string)
3) It's unclear what you mean by "html5 page". Assuming you mean "html document which conforms to the syntax of the most recent html5 draft published by the W3C", you're not actually allowed to leave out the html element.
...of course, I'm not actually sure what you mean by "validating" either, but you shouldn't use any particular validator on the internet, as it introduces a layer of indirection. Just use the syntax given by the spec itself: http://www.w3.org/TR/html5/syntax.html#syntax
And finally, since I despise people who criticize without offering alternatives, here's my attempt at the shortest conforming HTML document: "<!doctype html><html><title></title><body></body></html>"
As a sidenote: I'm not sure, but it might be conforming to re-write empty tags as <tagname /> instead of <tagname></tagname>, in which case the smallest conforming document would be: "<!doctype html><html><title /><body /></html>"
While we're on the subject of pedantry:
1) Given the unclear use of "smallest", !doctype is smaller, because lowercase letters are smaller than uppercase letters.
2) Your newlines unnecessarily add two extra characters to the page (arguably three if you count the newline after the title string)
3) It's unclear what you mean by "html5 page". Assuming you mean "html document which conforms to the syntax of the most recent html5 draft published by the W3C", you're not actually allowed to leave out the html element.
...of course, I'm not actually sure what you mean by "validating" either, but you shouldn't use any particular validator on the internet, as it introduces a layer of indirection. Just use the syntax given by the spec itself: http://www.w3.org/TR/html5/syntax.html#syntax
As a sidenote, you could also use the syntax given by the WHATWG's living spec, but the shortest conforming html document turns out to be the same regardless. WHATWG syntax: http://www.whatwg.org/specs/web-apps/current-work/multipage/...
And finally, since I despise people who criticize without offering alternatives, here's my attempt at the shortest conforming HTML document: "<!doctype html><html><title></title><body></body></html>"
As a sidenote: I'm not sure, but it might be conforming to re-write empty tags as <tagname /> instead of <tagname></tagname>, in which case the smallest conforming document would be: "<!doctype html><html><title /><body /></html>"