rel=canonical is an HTML attribute used to indicate the preferred URL of a webpage, when there are multiple versions of the same content. It helps search engines understand which URL to prioritize and prevent duplicate content issues.