Canonical www vs non www

I have taken on a couple of old websites which were never given a preferred “www” or “non www” and never re-directed in .htaccess.

I’d like to sort this now but, having been live for some years, I’m concerned that one version may have better google ranking than the other and I want to make sure I canonicalise the higher ranked version.

Anyone know if my concerns are justified and if so, how to find out which version is better ranked?

there is a page rank widget for most browsers