What is the use of canonical tag?

Hey Friends,
I am not understanding the use of canonical tag. I know that it is use for Duplicate content. I have write a rule in 301 (www and without www will redirect on same url).

In short, a canonical tag is used to indicate the preferred url for one page. You may use more than one URL for that page but there may be one version that you prefer to see in the search results.

Maybe these articles can help you on what it is and how to use it

http://googlewebmastercentral.blogspot.com.es/2013/04/5-common-mistakes-with-relcanonical.html

As you can see in this article, Matt Cuts (Google) prefers redirection more than the use of the canonical tag itself. Still, it is also supported by Yahoo and Bing so it is worth it to give it some consideration

I never undesrstood the canonical tag before ,thanks for explaining.But I think it carries a little weight in SEO these days.

Its only purpose is SEO. It basically tells the search engines which address to use where there are a whole lot of similar pages with what would be considered by the search engines to be duplicate content. Without the canonical tag you are letting the search engine decide for itself which of the addresses to use.