HTML Tidy is a W3C created tool for checking HTML.
Tidy Download and Info
CLI useage:
tidy -f error.txt -m filename.html
a) -f = put errors into errors.txt
b) -m = update the original file, instead of creating a new updated file.
c) tidy -help|more = the documentation
HTML documents are supposed to start with a Document Type Definition:
<!DOCTYPE html PUBLIC "-//w3c//DTD HTML 4.01 Transitional//EN">
The documents will get read by a browser the same without this tag. I don't really understand it's usefulness.
To find out more about the DTD check
W3C's DTD page
.
HTML Tidy is also able to determine what DTD you are coding in somehow.