# Raw HTML / source code

Category: [Rendering & JavaScript](https://seo-geo-glossary.com/en/glossary/category/rendering-javascript/) › [How search engines render](https://seo-geo-glossary.com/en/glossary/category/rendering-javascript/how-search-engines-render/) · Also known as: source code, view source, initial HTML, page source

**Raw HTML** is the source code of a web page as the server delivers it in the HTTP response, before a browser or crawler has run any JavaScript. It is also called the page source or initial HTML. The related term "source code" has a broader meaning in programming, but in SEO it usually points to this document.

## What is the difference between raw and rendered HTML?

A browser reads the raw HTML and builds the DOM from it. If the page then runs JavaScript, the content can change. The state after scripts have run is the rendered HTML. The Firefox documentation puts it this way. View Source shows the original HTML as sent by the server, while the Inspector shows the live DOM including all dynamic changes.

For SEO the difference matters because crawlers handle the two versions differently. Google fetches the raw HTML, renders the page later in a headless Chromium and works with the rendered result. Google also states that not all bots can run JavaScript. Titles, canonical tags, links and important text that sit in the raw HTML are readable by every crawler. Anything that only JavaScript adds depends on a successful rendering.

## How to view both versions

- **Raw HTML.** Use "View page source" in the browser, the `view-source:` prefix in the address bar on desktop, or a request with `curl`.
- **Rendered HTML.** Use the Elements panel in developer tools, or the URL Inspection tool in Search Console, where Google recommends checking that rendered HTML contains the expected content.

## Example

```bash
curl -s https://example.com/product | grep -i "<h1"
```

If the command returns no `<h1>` line but the browser shows a heading, JavaScript creates that heading. It is then missing from the raw HTML and only present in the rendered version.

## Common mistakes

- **Adding important elements only with JavaScript**: Not every bot runs JavaScript. Content, links, titles and canonical annotations in the raw HTML are readable for every crawler.
- **Links without `href`**: Google discovers links only when they are `<a>` elements with an `href` attribute.
- **Conflicting canonical annotation**: If JavaScript sets a canonical URL, it must match the value in the raw HTML.

## FAQ

**How do I see the source code of a web page?** Open the browser's context menu and choose "View page source", or use `view-source:` in front of the URL.

**Why does view source not work on my phone?** Mobile versions of Chrome do not offer the `view-source:` command, according to tools that exist to fill this gap.

*Diagram: Raw HTML vs. rendered HTML.* The raw HTML of a JavaScript page lacks the title, heading and links. Google indexes the rendered HTML and parses it for links again.

## Not to be confused with

- [Rendered HTML](https://seo-geo-glossary.com/en/glossary/rendered-html/index.md): is the state of the page after JavaScript has run. Google renders the page after fetching it in a headless Chromium and indexes that result.

## Related terms

- [Rendered HTML](https://seo-geo-glossary.com/en/glossary/rendered-html/index.md)
- [Text-to-HTML ratio](https://seo-geo-glossary.com/en/glossary/text-to-html-ratio/index.md)
- [HTML sitemap](https://seo-geo-glossary.com/en/glossary/html-sitemap/index.md)
- [DOM](https://seo-geo-glossary.com/en/glossary/dom/index.md)
- [JavaScript SEO](https://seo-geo-glossary.com/en/glossary/javascript-seo/index.md)
- [Rendering](https://seo-geo-glossary.com/en/glossary/rendering/index.md)

## More on the searchVIU blog

- [JavaScript Crawling Study: Rendered vs. Non-Rendered HTML](https://www.searchviu.com/en/javascript-crawling-study-rendered-html-vs-original-source-code/)

## Sources

- [View Source – Firefox Source Docs](https://firefox-source-docs.mozilla.org/devtools-user/view_source/index.html)
- [Introduction to the DOM – MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction)
- [JavaScript SEO basics – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)
- [Fix search-related JavaScript problems – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript)

---

Last updated: October 8, 2026
URL: https://seo-geo-glossary.com/en/glossary/raw-html-source-code/
