Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

When I'm developing a website locally sometimes I want to check if the html is valid but I haven't been able to find a good tool. I want it partial as a sanity check when I'm troubleshooting layout issues.

Can you please suggest a tool that can validate HTML offline? I'm not looking for validation inside of an IDE but something that will load the page from the web server.

Thank you!

share|improve this question
add comment

5 Answers 5

up vote 21 down vote accepted

You can download the source and/or packages direct from w3[1].

[1] http://validator.w3.org/source/

share|improve this answer
1  
+1, and they have a LOT of other really cool tools and libraries available for download. –  Tim Post Aug 1 '10 at 20:15
add comment

To save time I use a Firefox Extension called HTML Validator. It adds validation to your view source window, tells you errors and warnings in a bottom pane. Also puts an icon in the bottom of your window showing you a quick reference for yes/no on validation. If no, then you just view source and it shows you exactly what your errors are.

Also validates accessibility.

share|improve this answer
1  
Oh yeah. Validate as you go. Saves you an extra manual step on each page. Hasn't yet been updated for HTML5, though. –  Grant Palin Aug 2 '10 at 6:24
add comment

Have you checked out HTML Tidy?

share|improve this answer
    
This is a very good solution too; and since they provide binaries for almost all platforms it's also a good option for beginners. –  fwaechter Aug 1 '10 at 21:43
add comment

You can validate HTML and CSS locally (and do a lot of other useful things) with the Web Developer Toolbar add-on for Firefox. It's also available for Google Chrome.

share|improve this answer
    
This is just a quick way of submitting it to the W3C validator. Hardly 'offline'. –  Kris Aug 1 '10 at 21:13
    
Apologies, I misread the question. You can validate locally, but not offline. –  Virtuosi Media Aug 1 '10 at 21:26
add comment

In Debian/Ubuntu you can do:

sudo apt-get install w3c-markup-validator

This will get you the web interface.

If you want to validate from the console, edit /usr/share/doc/w3c-markup-validator/examples/validate.pl and install libwebservice-validator-html-w3c-perl. Now you can run validate.pl with an URL to validate.

share|improve this answer
    
This works great in browser. Could you describe how to edit validate.pl so it can be run from command line with local file? I don't know python and am not sure how to do it. –  Rafal Oct 13 '13 at 11:32
1  
@Rafal: you just need to fix the URL so that it points at the webserver that hosts the w3c-markup-validator (which is CGI). It may be that the URL is already fits, if you're running your webserver on port 80. Before installing the console stuff, make sure it works in the browser. That way, you're also sure the URL is correct. Also, it's Perl, not Python. –  Janus Troelsen Oct 13 '13 at 19:51
add comment

Your Answer

 
discard

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.