Practical guideUpdated

Internal and external links in HTML, with examples

An internal link points to another page on the same website, for example <a href="/pricing">Pricing</a>. An external link points to a different website, for example <a href="https://developers.google.com/search">Google Search Central</a>. Both use the HTML anchor tag with an href attribute. For SEO, internal links help search engines discover and understand your pages; external links cite sources and can be qualified with rel attributes.

This page gives copy-ready HTML examples for each kind of link, explains the attributes that matter, and then covers what each type does for SEO. It is aimed at people writing HTML by hand or checking what a CMS outputs.

By , Founder, SerionFlow

What we measured ·

What Google shows for "example of internal and external linking in html" right now

Method: Live Google results (United States, desktop, English) for "example of internal and external linking in html" retrieved through DataForSEO's SERP API on 2026-10-22. Page types are our own classification of each ranking URL.

The top 8 organic results for "example of internal and external linking in html" were 7 product or service pages, 1 forum or community thread. The first three were www.w3schools.com, dpvipracollege.ac.in, www.geeksforgeeks.org. Community threads (stackoverflow.com) ranked on page one, a sign searchers want first-hand answers, not only vendor pages.

Google returned an AI Overview placeholder that loads after the page, so whether the Overview appears for a given searcher, and which sources it cites, could not be captured.

People Also Ask listed: "What are internal and external links in HTML?"; "Can you provide an example of an external link in HTML?"; "Can you provide an example of an internal link in HTML?"; "How to link external links to HTML?". The sections below answer the ones within this page's scope.

Top organic results for "example of internal and external linking in html", 2026-10-22
PositionDomainPage type
1www.w3schools.comProduct or service page
2dpvipracollege.ac.inProduct or service page
3www.geeksforgeeks.orgProduct or service page
4clearlydecoded.comProduct or service page
5www.scribd.comProduct or service page
6stackoverflow.comForum or community thread
01

HTML examples

Each example is a complete anchor element.

Internal and external link examples
Link typeHTMLNotes
Internal, relative path<a href="/guides/aeo-checklist">AEO checklist</a>Most common; works on any domain
Internal, same page section<a href="#pricing">See pricing</a>Jumps to the element with id="pricing"
Internal, absolute URL<a href="https://www.example.com/pricing">Pricing</a>Fine, but must match the canonical host
External<a href="https://developers.google.com/search">Google Search Central</a>Full URL with protocol
External, new tab<a href="https://example.org" target="_blank" rel="noopener">Example</a>noopener protects the original tab
External, sponsored<a href="https://partner.com" rel="sponsored">Partner</a>Required for paid or affiliate links
02

The attributes that matter

href is the destination. target="_blank" opens a new tab; modern browsers apply noopener by default, but adding rel="noopener" is still a sensible habit. rel qualifies the relationship: nofollow asks search engines not to associate your site with the link, sponsored marks paid or affiliate links, and ugc marks links in user-generated content such as comments. Google treats these as hints. title adds a tooltip but carries little SEO value.

03

What internal links do for SEO

Search engines discover most pages by following links, so an important page with no internal links, called an orphan page, may be crawled rarely or not at all. Internal links also signal which pages matter and what they are about through anchor text. Link from relevant pages to related pages with descriptive anchors such as 'robots.txt checker' rather than 'click here'. Use real anchor elements with href values; links created only by JavaScript click handlers may not be followed.

04

What external links do for SEO

Linking to authoritative sources helps readers verify claims and is a normal part of a trustworthy page. There is no penalty for linking out to good sources. Use rel="sponsored" for paid links and rel="nofollow" for links you do not want to vouch for. Links from other sites to yours, called backlinks, are a separate subject and remain an important ranking signal.

05

Checking the links on a page

View the page source and search for <a to see what the HTML actually contains, since some frameworks render links differently than they appear. Our free broken link checker lists every link on a page with its status code, and the internal link opportunity finder suggests pages on your site that should link to each other. SerionFlow is the wrong tool for editing links inside your existing pages; it links the pages it publishes and suggests links for the rest.

Clear answers

Frequently asked questions

What is the difference between an internal and an external link?

+

An internal link points to a page on the same domain; an external link points to a page on a different domain.

Should internal links use relative or absolute URLs?

+

Either works. Relative URLs are simpler and survive domain changes; absolute URLs must use the exact canonical protocol and host to avoid redirects.

About the author

· Founder, SerionFlow

Shadrack builds SerionFlow's site research, page generation, and Search Console tooling, and runs the free tools these guides pair with. Search Console figures cited on these pages come from serionflow.com's own property.

Continue exploring

Related SerionFlow resources

More in Guides

All guides

Make the next move obvious

Let SerionFlow turn your market evidence into momentum.

Confirm the market, rank the opportunities that matter, create brand matched pages on your domain, and keep moving with controlled weekly intelligence.

Choose how SerionFlow uses cookies.

Essential cookies keep the site secure and working. Product analytics helps us improve reliability. Optional cookies help us remember preferences and improve campaigns. You can change optional cookies anytime in Cookie Settings.