20

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!

24

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

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

11

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.

  • 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
5

Have you checked out HTML Tidy?

  • 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
4

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.

  • 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
2

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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