Skip to main content

Canonical Tag Generator

Runs in your browser Nothing stored Free, no signup

Paste a URL and get a clean canonical tag in three formats — HTML, Next.js metadata, and an HTTP header. It normalizes the protocol and strips tracking parameters automatically.

HTML (in <head>)
<link rel="canonical" href="https://example.com/Blog/My-Post/" />
Next.js (App Router metadata)
export const metadata = {
  alternates: { canonical: 'https://example.com/Blog/My-Post/' },
};
HTTP header
Link: <https://example.com/Blog/My-Post/>; rel="canonical"

A canonical should be absolute, use your real protocol and host, and point to the clean version of the page. The safest default is a self-referencing canonical on every indexable page — it pre-empts duplicates from tracking parameters and trailing-slash variants.

The tag that quietly prevents duplicate content

Most duplicate-content problems aren't plagiarism — they're the same page reachable at slightly different URLs: with and without a trailing slash, with a tracking parameter, on www and non-www. A self-referencing canonical on every page tells Google which one counts, so ranking signals don't get split.

On Next.js there's a specific gotcha worth knowing: a canonical set in the root layout is inherited by child routes, which can accidentally point every page at your homepage. The Next.js canonical guide covers it, and the HTTP header checker lets you confirm what's actually being served.

Frequently asked questions

What is a canonical tag?

A rel="canonical" tag tells search engines which URL is the master version when the same or similar content is reachable through multiple URLs — query strings, trailing slashes, http vs https. It consolidates ranking signals onto the one URL you want indexed.

Should every page have a canonical?

A self-referencing canonical on every indexable page is the safest default. It pre-empts duplicates created by tracking parameters and URL variants. The one thing to avoid is a single hard-coded canonical shared across many different pages.

Absolute or relative URL?

Use an absolute URL (with https and your full domain). Relative canonicals are technically allowed but riskier — an absolute URL leaves no ambiguity about the exact page you mean.

Does a canonical guarantee that URL is indexed?

No — it is a strong hint, not a directive. Google can override it if other signals disagree. Make your internal links, sitemap, and redirects all point at the same canonical URL so the signals reinforce each other.

Related tools

This tool solves one thing.

Scan a live URL against 100 on-page checks — with the code to fix each issue.

Analyze any URL free