How to Find Keywords in Source Code: A Practical SEO Inspection Guide

Quick Answer
To learn how to find keywords in source code, open a webpage in Chrome, right-click and select View Page Source, then press Ctrl+F (Windows/Linux) or Command+F (Mac) to search its HTML. Inspect the title, headings, body text, image alt attributes, and link text. For JavaScript-generated content, use Chrome DevTools to examine the rendered HTML as well.
Key Takeaways
- View Page Source reveals the original HTML returned by a webpage.
- The title, H1, H2/H3 headings, body text, image alt attributes, and anchor text are useful places to identify keyword usage.
- Chrome DevTools helps you find content added or changed by JavaScript.
- Record each phrase alongside its HTML location and surrounding context rather than collecting isolated words.
- The meta keywords tag is not a Google ranking factor.
- Finding a keyword in source code does not prove that a page ranks for it or that people search for it.
What Does Finding Keywords in Source Code Actually Mean?
Every webpage has an underlying document that tells a browser what to display. Most websites use HTML (HyperText Markup Language), which organizes information into elements such as headings, paragraphs, links, and images.
Some of those elements contain words and phrases that describe the subject of the page. By examining the HTML, you can identify how a website presents its main topic and supporting subjects.
For example, imagine a website publishing an article about local SEO services. Its HTML might contain:
- A title mentioning local SEO services.
- An H1 describing how to choose a local SEO provider.
- H2 headings about local citations and business listings.
- Paragraphs discussing Google Business Profile and local search.
- Image descriptions mentioning business listings.
- Links pointing to related SEO resources.
These elements provide evidence about the language and topics used on the page.
However, there are three different activities worth separating:
- Source-code inspection: Finding words and phrases that appear in the webpage's HTML.
- Search-engine interpretation: Understanding how a search engine processes and interprets the page.
- Ranking research: Discovering the actual search queries for which a page receives impressions or ranks.
Source-code inspection helps with the first task. It does not independently establish the other two.
Google's SEO Starter Guide explains the importance of useful content, descriptive titles, headings, and crawlable links. These are sensible locations to examine when investigating a webpage's SEO implementation.
How to Find Keywords in Source Code Using View Page Source
The easiest approach requires no paid SEO software or browser extension. You only need a browser and the URL of a publicly accessible webpage.
Step 1: Open the webpage
Open Chrome and visit the webpage you want to examine.
You can inspect your own website or a competitor's publicly accessible page. Make sure you are examining the correct URL, particularly if the website redirects between different versions of a page.
Step 2: Open the original HTML source
There are two straightforward ways to access the source.
Method A: Use the right-click menu
- Open the webpage.
- Right-click anywhere on the page.
- Select View Page Source.
- A new browser tab opens with the original HTML document.
Method B: Use the browser address bar
You can also enter the following address in Chrome's address bar:
``text
view-source:https://example.com/page/
``
Replace the example URL with the actual webpage you want to inspect.
The source view displays the HTML document returned to the browser. Depending on the website, it may include metadata, headings, text, links, image attributes, scripts, and other markup.
Step 3: Search for a specific keyword
Once the source is open, use the browser's Find function.
| Operating system | Keyboard shortcut |
|---|---|
| Windows | Ctrl + F |
| Linux | Ctrl + F |
| macOS | Command + F |
Enter a keyword or phrase into the search box.
For example, if you are inspecting a page about website indexing, search for phrases such as:
- website indexing
- Google indexing
- URL inspection
- search engine crawling
- indexing status
The browser highlights matching text in the source.
Do not stop at the first result. Check where the phrase appears. A keyword inside an H1 has a different context from the same phrase inside a navigation link, script, or unrelated footer element.
Step 4: Identify the HTML element containing the keyword
Look at the surrounding markup to understand what the phrase represents.
For example:
``html
<h1>How to Improve Website Indexing</h1>
``
Here, the phrase appears in the main heading.
Compare it with:
``html
<a href="/website-indexing/">Website indexing guide</a>
``
This occurrence is anchor text, which describes a linked destination.
The same words can have different meanings depending on their location. Record the element as well as the phrase.
Step 5: Search for related expressions
After checking your initial phrase, look for related language throughout the document.
A page about website indexing might also contain:
- Search engine discovery
- Crawlable pages
- XML sitemap
- Canonical URL
- Robots directives
- Google Search Console
These expressions can reveal supporting subjects that are not obvious from the main heading alone.
You are identifying the page's actual language, not proving that every related expression is a separate target keyword.
Search Engine Land also describes using View Page Source and the browser's Find function to locate keywords. Its guide to searching a website for keywords provides a useful starting point for this inspection method.
Where to Look for Keywords in a Webpage's HTML
Searching for a phrase is only the beginning. The next step is understanding which HTML locations provide useful information.
The following Keyword Location Audit Matrix gives you a repeatable way to interpret what you find.
Keyword Location Audit Matrix
| HTML location | What to inspect | What it can reveal | Important limitation |
|---|---|---|---|
| HTML title | Text inside the <title> element | The page's declared subject | Does not prove rankings |
| H1 | Main heading | The primary visible topic | Not a ranking guarantee |
| H2/H3 | Section headings | Supporting subjects and subtopics | Some may be navigational or unrelated |
| Meta description | Description content attribute | Publisher-provided page summary | Google may generate a different snippet |
| Meta keywords | Legacy keywords attribute | Historical or application-specific labels | Google ignores this tag for ranking and indexing |
| Body text | Paragraphs and lists | Main subject language and related concepts | Does not establish search demand |
| Image alt | Alternative text | Description of meaningful image content | Should describe the image, not list unrelated keywords |
| Anchor text | Text inside links | Topics associated with linked destinations | Does not establish destination-page rankings |
| Structured data | JSON-LD and relevant markup | Machine-readable page information | Not a complete keyword inventory |
Let's examine the most useful locations in more detail.
1. HTML title
The title element usually appears inside the document's <head> section.
Example:
``html
<title>Local SEO Services: A Practical Guide</title>
``
This tells you how the publisher has declared the page's subject in its HTML title.
Google may use several sources when generating a search-result title link, including the HTML title, prominent headings, and other page information. It does not necessarily display the exact title element in every search result.
See Google's documentation on how title links are generated.
2. H1 headings
The H1 is generally the main visible heading of an article or page.
Example:
``html
<h1>How to Find Keywords in Source Code</h1>
``
This is a useful indication of the page's central subject. Check whether the heading accurately describes the visible content. Also inspect the surrounding document because websites sometimes contain multiple heading elements for different sections or interface components.
3. H2 and H3 headings
Subheadings help reveal the supporting topics covered by an article.
Example:
``html
<h2>How to Inspect Website HTML</h2>
<h2>Understanding Keyword Placement</h2>
<h3>Checking Image Alt Attributes</h3>
``
These headings can expose related concepts and the way a publisher organizes its content. They are especially useful when researching a long article because they help you identify sections without reading every paragraph first.
4. Meta description
The meta description is commonly located in the document's <head> section.
``html
<meta name="description" content="Learn how to inspect webpage HTML and identify important SEO elements.">
``
It describes the page for search-result snippet purposes, although Google may choose different text from the page. A description can contain useful topic language, but its presence does not prove that a phrase is a ranking keyword.
For a deeper explanation of metadata fields, see Meta Title Meta Description Meta Keywords: What Matters for SEO.
One important distinction: the old meta keywords tag is not useful for improving Google rankings. Google explicitly lists it among the unsupported meta tags. Finding it in source code is evidence of a legacy or application-specific field, not an effective Google SEO technique.
Official reference: Google's supported meta tags.
5. Body text
The main page content is often the most useful place to discover the language actually used to explain a topic.
Look for:
- Paragraphs.
- Ordered and unordered lists.
- Explanatory examples.
- Definitions.
- Supporting sections.
For example, an article about keyword research might naturally mention search intent, related phrases, search results, and content relevance.
Record expressions that contribute meaning to the subject. Avoid treating every repeated word as an important keyword.
6. Image alt attributes
Image alt text describes an image's content or purpose.
Example:
``html
<img src="keyword-research.jpg" alt="SEO specialist reviewing keyword research data">
``
This provides descriptive context about the image. Alt text can also function as anchor text when an image is used as a link. Google's documentation on crawlable links explains this relationship.
Good alt text describes meaningful image content. It should not be filled with unrelated keyword variations simply to increase the number of terms found in source code.
7. Anchor text
Anchor text is the clickable text inside a link.
Example:
``html
<a href="/technical-seo/">Technical SEO guide</a>
``
The phrase tells readers and search engines something about the linked destination.
When inspecting a competitor's page, check both internal and external links. Their anchor text can reveal related topics, resources, and the site's linking structure.
However, anchor text on one page does not independently prove that the destination ranks for that phrase.
8. Structured data
Structured data provides machine-readable information about a webpage or entity. One common format is JSON-LD, which is often placed inside a script element.
Example:
``html
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Find Keywords in Source Code",
"description": "A guide to inspecting HTML for keyword information."
}
</script>
``
This example identifies an article and supplies a headline and description. Structured data can provide useful supplementary context, but it is not a complete inventory of the terms on a page. It should not replace inspection of visible content and other HTML elements.
How to Find More Keywords With Chrome DevTools
Sometimes View Page Source does not show all the content you see in the browser. This can happen when a website uses JavaScript to create or modify page content after the initial HTML response.
To inspect the current page structure, use Chrome DevTools.
Step 1: Open the webpage
Navigate to the page you want to examine.
Step 2: Open Inspect
Right-click an element on the page and select Inspect.
Alternatively, use:
- Windows/Linux: Ctrl + Shift + I
- macOS: Command + Option + I
Chrome DevTools will open, usually displaying the Elements panel.
Step 3: Examine the Elements panel
The Elements panel displays the current Document Object Model, or DOM. The DOM is the browser's structured representation of the document. It allows you to examine individual elements and their attributes.
Expand the HTML tree and inspect:
- The
<head>section. - The
<title>element. - Heading elements.
- Paragraphs and lists.
- Image attributes.
- Anchor elements.
Clicking an element in the panel can help you identify the corresponding content on the page.
Step 4: Search the rendered document
Press Ctrl+F on Windows/Linux or Command+F on macOS while working in the Elements panel.
Enter your keyword or phrase. DevTools searches the current DOM and helps you locate matching elements, including content that may have been added after the initial page response.
Step 5: Compare the two results
If a phrase appears in DevTools but not in View Page Source, investigate whether JavaScript or another page process added it.
Do not immediately assume that one result is incorrect. They represent different stages of the webpage.
Chrome provides further guidance in its DOM inspection documentation.
How to Extract and Organize Keywords From Source Code
Finding individual terms is useful, but a structured record makes the research much more valuable. A simple worksheet prevents you from mixing metadata, visible content, descriptive text, and unrelated interface elements.
A fictional HTML example
Imagine a fictional website publishing an article about technical SEO audits. Its HTML might look like this:
```html <!DOCTYPE html> <html lang="en"> <head> <title>Technical SEO Audit: A Practical Guide</title> <meta name="description" content="Learn how to perform a technical SEO audit."> </head> <body> <article> <h1>Technical SEO Audit: A Practical Guide</h1>
<p>A technical SEO audit helps identify website issues affecting crawling and page accessibility.</p>
<h2>Website Crawling and Indexing</h2>
<p>Review crawlability, internal links, and indexable pages during your website audit.</p>
<h2>Page Performance and Technical Issues</h2>
<img src="seo-audit.jpg" alt="Technical SEO audit dashboard">
<a href="/website-indexing/"> Website indexing guide </a> </article>
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "headline": "Technical SEO Audit: A Practical Guide", "description": "An introduction to technical SEO audits." } </script> </body> </html> ```
This is a fictional example, not a real website audit or measured keyword result.
Extract the keyword observations
| Extracted term or phrase | HTML location | Evidence type | Interpretation |
|---|---|---|---|
| Technical SEO audit | Title | Metadata | Declared primary subject |
| Technical SEO audit | H1 | Main heading | Main visible topic |
| Website crawling and indexing | H2 | Supporting heading | Related subject |
| Page performance | H2 | Supporting heading | Supporting concept |
| Crawlability | Body text | Contextual language | Technical supporting term |
| Internal links | Body text | Contextual language | Related SEO concept |
| Technical SEO audit dashboard | Image alt | Descriptive text | Image-related context |
| Website indexing guide | Anchor text | Link context | Related linked destination |
| Technical SEO Audit: A Practical Guide | JSON-LD headline | Structured data | Supplementary machine-readable information |
Notice that the same phrase may appear in several locations. You should record those occurrences without automatically counting them as separate keyword opportunities.
Use this reusable keyword extraction worksheet
For each webpage you inspect, record the following information:
| Field | What to enter |
|---|---|
| Extracted term | The exact word or phrase found |
| HTML location | Title, H1, H2, body, alt, anchor, or structured data |
| Surrounding context | The sentence or heading containing the term |
| Evidence type | Metadata, visible content, descriptive text, or machine-readable data |
| Interpretation | Primary topic, supporting concept, or supplementary information |
You can maintain this worksheet in Excel, Google Sheets, or a simple spreadsheet.
Classify the findings
After collecting the phrases, group them into four useful categories.
Primary topic: Terms that directly describe the central subject of the page.
Supporting concepts: Related subjects that help explain the main topic.
Descriptive text: Language used in image descriptions, links, and other supporting elements.
Metadata: Information supplied through HTML title and description fields or structured markup.
This classification makes it easier to compare two pages without treating every occurrence as equally important.
Original HTML vs. Rendered DOM: Which Should You Check?
Both inspection methods are useful, but they answer slightly different questions.
The original HTML represents the document response received by the browser. The rendered DOM represents the document structure after the browser has processed the page, including applicable JavaScript changes.
| Comparison | View Page Source | Chrome DevTools Elements |
|---|---|---|
| Main purpose | Inspect original HTML | Inspect current DOM |
| JavaScript-generated content | May be absent | Can appear after execution |
| Original metadata | Useful for checking | Shows current DOM metadata |
| Visible page elements | Depends on initial HTML | Shows current document structure |
| Best use | Check what the server initially returned | Investigate the page as currently rendered |
Why can the results differ?
Consider a website that loads its main article through JavaScript.
The initial HTML response might contain a basic page shell:
``html
<div id="app"></div>
<script src="app.js"></script>
``
After the browser executes the JavaScript, the page may contain additional content:
``html
<div id="app">
<h1>Technical SEO Audit Guide</h1>
<p>Learn how to inspect website crawlability.</p>
</div>
``
The keyword phrases in the second example may not appear in the original source, even though they become visible in the rendered document.
Google explains this process in its JavaScript SEO Basics documentation. Its crawling, rendering, and indexing processes matter because some content is exposed only after JavaScript execution.
Google also documents how to view the rendered source of a page.
A practical source-versus-DOM checklist
When inspecting an unfamiliar webpage, follow this comparison:
- Open View Page Source and search for your main phrase.
- Record whether it appears in the initial HTML.
- Open Chrome DevTools and select Elements.
- Search the rendered DOM for the same phrase.
- Compare headings, paragraphs, metadata, and image descriptions.
- Investigate meaningful differences, particularly when important content is missing from the initial response.
- Record which inspection method revealed each phrase.
This process provides a clearer picture of how the webpage is constructed without assuming that the original HTML and rendered document are identical.
What Source-Code Keywords Can and Cannot Tell You
Source-code inspection is useful for understanding a webpage's content and HTML implementation. However, its findings have important limitations.
What you can discover
You can identify:
- The subject declared in the HTML title.
- The main and supporting headings.
- Terms used in paragraphs and lists.
- Descriptive language in image alt attributes.
- Topics referenced by anchor text.
- Metadata and structured-data information.
- Differences between initial HTML and the rendered DOM.
These observations help you understand how a publisher organizes and describes a webpage.
What you cannot establish from source code alone
Actual Google rankings: A keyword appearing in an H1 or paragraph does not prove that the page ranks for it.
Search volume: HTML does not tell you how many people search for a particular phrase.
Complete competitor keyword coverage: A page's source code does not reveal every query for which the website receives impressions or traffic.
Guaranteed indexing: Finding well-placed keywords does not establish that Google has indexed the page.
Ranking importance of every occurrence: A phrase in a footer, script, heading, and paragraph should not automatically receive the same interpretation.
A universal keyword-density target: Counting repeated phrases does not provide a reliable formula for ranking improvements.
If your actual objective is to discover search queries for which a webpage ranks, you need a different evidence source. Google Search Console can provide performance information for websites you control. See How to See What Keywords a Page Is Ranking For Using Search Console and SEO Tools.
Similarly, keyword placement and Google indexing are separate subjects. Our guide to Google Indexing and Keywords: What Actually Gets Content Indexed? explains that distinction.
A Practical Workflow for Inspecting Competitor Pages
You can use the same process to examine several publicly accessible competitor pages.
Start by selecting pages that genuinely address the same subject. Comparing unrelated pages can produce misleading conclusions.
For each page:
- Record its URL and the date of inspection.
- Open the original HTML using View Page Source.
- Search for the main subject and relevant variations.
- Record the title and heading structure.
- Examine body text, image alt attributes, and anchor text.
- Inspect structured data where relevant.
- Open Chrome DevTools to check the rendered DOM.
- Record meaningful differences between the original source and rendered document.
- Classify the observations using the Keyword Location Audit Matrix.
- Compare the resulting topic coverage across the selected pages.
For a useful comparison, focus on the concepts each page actually explains rather than simply counting how often a phrase appears.
You can perform this work with ordinary browser tools. Paid keyword research platforms are not necessary to inspect publicly accessible HTML.
Be respectful when examining competitor websites. Work with publicly accessible pages, avoid bypassing authentication or technical restrictions, and do not attempt to access private source code or restricted systems.
Frequently Asked Questions
How do I find keywords in HTML source code?
Open the webpage in Chrome, right-click and select View Page Source. Press Ctrl+F on Windows/Linux or Command+F on Mac, then enter the phrase you want to find. Examine the surrounding HTML to identify whether it appears in a title, heading, paragraph, link, or another element.
What is the difference between View Page Source and Inspect?
View Page Source displays the original HTML document returned to the browser. Inspect opens Chrome DevTools, where the Elements panel shows the current DOM after applicable browser and JavaScript processing. Both are useful for different stages of page inspection.
Can I find competitor keywords without an SEO tool?
Yes. You can identify terms present in a competitor's publicly accessible HTML using View Page Source and Chrome DevTools. However, this method cannot establish the competitor's actual ranking queries, search traffic, or keyword search volume.
Where are keywords located in HTML?
Useful locations include the title element, H1 and H2/H3 headings, body text, meta description, image alt attributes, anchor text, and relevant structured data. The context of each occurrence matters more than simply finding the phrase.
Does the meta keywords tag help Google rankings?
No. Google does not use the meta keywords tag for indexing or ranking. You may still encounter it in older websites or applications, but its presence is not evidence of an effective Google ranking technique.
Can JavaScript hide keywords from View Page Source?
JavaScript can add or modify page content after the original HTML is received. As a result, a phrase may be missing from View Page Source but appear in the rendered DOM. Use Chrome DevTools to investigate these differences.
Does finding a keyword in source code mean a webpage ranks for it?
No. It only confirms that the phrase appears in the inspected HTML or rendered document. Actual ranking evidence requires search-performance data, such as Google Search Console information for a property you control.
Final Thoughts
Learning how to find keywords in source code gives you a straightforward way to understand how websites describe their subjects and organize their content.
Start with View Page Source and the browser's Find function. Examine the title, headings, body text, alt attributes, and links. Then use Chrome DevTools when JavaScript or dynamic content makes the original HTML incomplete.
Most importantly, organize what you discover. The Keyword Location Audit Matrix and extraction worksheet help distinguish primary topics from supporting concepts, descriptive text, and metadata.
Source-code inspection is a practical SEO research technique, but it is not a substitute for ranking or search-volume data. Used with that distinction in mind, it gives you a repeatable, evidence-based method for understanding the keywords and topics present in any publicly accessible webpage.