Source HTML vs. Rendered HTML

Google Search Central · Beginner ·🌐 Frontend Engineering ·3y ago
Skills: SEO & SEM70%

Key Takeaways

Understanding the difference between source HTML and rendered HTML for Google Search

Full Transcript

did you ever inspect the source of a website and wondered why it looks different from what you see in your browser when you open the same website or maybe you heard about the rendered html or the dom and don't know how these are different from what you see in view source for instance then this video is for you in this video i would like to take you on a journey behind the scenes of your browser so let's jump in [Music] to understand what happens between a server sending some html into your browser and the browser showing you the website in all its glory we need to start at the moment where you hit return in the address bar and ask a server somewhere on the internet to give a website to you the first step to get a website into your browser is to send an http request to the server that is hosting the website once the server receives the request the server chooses how to respond to it that can mean running a program like a php script or a java program or whatever or simply sending back the content of a file for this video we will skip over what exactly the server does and focus on the fact that the server usually starts sending a bunch of html back to the browser many people think of the html that was sent from the server as the same as the website you will see in your browser but that isn't really accurate instead we could say that what you see in the browser is a dish and the html that was sent is the recipe the browser needs to prepare or cook the dish based on the recipe it received from the server it turns the html into a number of visual and sometimes interactive elements that then show up on your screen the interesting part is what happens between the html and what you see in your browser this is called rendering let's look a little closer at rendering to see what happens in between the beginning the html that comes from the server and the end the interactive website that you well interact with to understand the difference between the html that we received from the server the so-called source html the rendered html and the dom we need to look closer at this rendering process the rendering process is a series of steps that start with the source html and if included the styling information in the css the browser starts by parsing the source html and if available any css found inside which creates two tree-like structures called the document object model dom for short and the css object model css om for short for us the dom is the more important of the two models so we'll focus on it from now on for our website for example the browser would create the following dom tree the browser needs this tree to identify individual elements on the website and their relationship to other elements like for instance which text belongs to the heading and which to the paragraph or what file is the source of this image the browser then takes the dom and cssom and figures out how to fit all this stuff into the browser window this is called layouting and creates a render tree the render tree basically contains the sizes and positions on the screen for each of the elements in the dom the browser uses this tree to paint the actual pixels that make up what we see in our browser window it is important to understand that once the browser shows us the website it may use javascript to allow us to interact with the website the javascript might then change the dom by adding changing or removing elements in the tree for example when i click this button it adds an image to the dom and thus to the website on the screen here we can see this in action on the left you see the interactive website on the right you see a representation of the dom that the browser uses for this website whenever the button is clicked the javascript adds a new image to the dom tree and the browser renders it in the previous example the dom tree might look different at any moment depending on what happened before the dom itself only lives in the browser memory and isn't visible per se but we can represent it in different forms one such form is the interactive tree view that we saw in the browser developer tools on the right hand side of the previous video alternatively we could turn the dom tree back into html we call this the rendered html when we turn the dom tree back into the rendered html we might get different results depending on what happened to the dom tree before for example the rendered html of the previous example website is exactly the same as the source html as long as the button was not clicked as the button is clicked javascript will run and we'll change the dom and in turn the rendered html now you may already wonder what is it that i see when i click view source in my browser well it's the source html or is it the rendered html there are three ways to see the source html coming from the server first and probably most known is to right click on a web page and select view source or typing view dash source colon in front of the url that shows you the source html alternatively you can also go into the developer tools on your browser select the sources tab and see the source html there here you can see that the right side shows the original html without the images that are currently visible on the website a third way is to use the network tab in the browser developer tools where you can also see the html that was sent back from the server but what options do i have if we want to see what's in the dom well again the browser developer tools have us covered the dev tools contain a tree tree-like representation of the dom that we can explore and interact with we find this in the elements tab in chrome you may notice that unlike the other dev tools panels and the view source this shows us the current dom content including the images that were added by javascript if we wanted to we can turn the dom back into html this can be quite complex thanks to things like the shadow dom or cross origin iframes but for simpler websites you can get the rendered html by going into the devtools console and running this javascript snippet again please note that this isn't always working especially for more complex websites for debugging i recommend that you use the url inspection tool in search console to get the rendered html that google search uses for indexing of a page all right so that was quite alright let's summarize what we learned today we started with a source html that's the html that a server sends to our browser when we open a web page then we learned that the browser turns this html into the dom that is an interactive element by element representation of the website constructed from the source html the dom can change as javascript might modify it while the page is loading upon the user interaction or other events while it is open in the browser and then last but not least we identified rendered html as a snapshot of that dom turned back into html the rendered html reflects the dom content on the page at the time the snapshot was taken to see the rendered html you can use the url inspection tool in the google search console so now we've looked at what's the source html the rendered html and the dom and explored what tools you could use to debug issues on your websites what tools are you using to debug issues on your websites let us know in the comments below and also thanks a lot for watching and please like and subscribe to stay in the loop with our latest and greatest content around google search thanks a lot and bye bye want more technical seo antics catch me on the search of the record podcast where we talk all things google search go behind the scenes and who knows maybe discuss my love for javascript yay join me martin and the google search relations elves and check us out wherever you download podcasts [Music]

Original Description

Did you know the HTML coming from the server might not be what Google Search sees? Martin Splitt, Developer Relations Engineer, explores the relationship between source HTML, rendered HTML, the Document Object Model (DOM), and the rendering process. Learn how to inspect the DOM in a browser, the differences between what Google tools show when inspecting a URL and when using 3rd party view-sources, and more behind the scenes info of your browser. Listen to Search Off the Record on Libsyn → https://goo.gle/3am6jMx Listen to Search Off the Record on Google Podcasts → https://goo.gle/3yIHvXt Listen to Search Off the Record on Spotify → https://goo.gle/3AynTaH Listen to Search Off the Record on Apple Podcasts → https://goo.gle/3RuHlLV 0:00 - Introduction 0:31 - What happens when your browser opens a webpage 2:27 - What are the rendered HTML and the DOM? 5:35 - How to debug your page by viewing both the source and rendered HTML 7:30 - Recap Watch all Search Central Lightning Talks → https://goo.gle/2VclBJz Subscribe to the Google Search Central Channel → https://goo.gle/SearchCentral #SearchLightningTalks #HTML #GoogleSearch
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Google Search Central · Google Search Central · 0 of 60

← Previous Next →
1 What do I do after being hacked?
What do I do after being hacked?
Google Search Central
2 Can rel="canonical" index my hostname and not my IP address?
Can rel="canonical" index my hostname and not my IP address?
Google Search Central
3 How can I optimize for "deep web" crawling?
How can I optimize for "deep web" crawling?
Google Search Central
4 What's a preferred site structure?
What's a preferred site structure?
Google Search Central
5 Should I tweak my titles and descriptions to improve my CTR?
Should I tweak my titles and descriptions to improve my CTR?
Google Search Central
6 When did Google start displaying "Did you mean" results?
When did Google start displaying "Did you mean" results?
Google Search Central
7 Can I tell Google not to use the posting date in my snippet?
Can I tell Google not to use the posting date in my snippet?
Google Search Central
8 Does the ordering of heading tags matter?
Does the ordering of heading tags matter?
Google Search Central
9 Which SEO agency do you recommend?
Which SEO agency do you recommend?
Google Search Central
10 Will SEO still exist in five years?
Will SEO still exist in five years?
Google Search Central
11 Star Wars or Star Trek?
Star Wars or Star Trek?
Google Search Central
12 Tips on requesting reconsideration
Tips on requesting reconsideration
Google Search Central
13 Do site load times have an impact on Google rankings?
Do site load times have an impact on Google rankings?
Google Search Central
14 Is Google doing anything different for Twitter results?
Is Google doing anything different for Twitter results?
Google Search Central
15 Will domain registration changes ding me in Google?
Will domain registration changes ding me in Google?
Google Search Central
16 How are load times displayed in Webmaster Tools calculated?
How are load times displayed in Webmaster Tools calculated?
Google Search Central
17 Why aren't penalized sites notified in Webmaster Tools?
Why aren't penalized sites notified in Webmaster Tools?
Google Search Central
18 Google India SearchMasters 2009 - Event Roundup
Google India SearchMasters 2009 - Event Roundup
Google Search Central
19 Can you talk about the change in Google's referrer string?
Can you talk about the change in Google's referrer string?
Google Search Central
20 Google Webmaster Help Forum - Koti Ivaturi - Google India SearchMasters '09
Google Webmaster Help Forum - Koti Ivaturi - Google India SearchMasters '09
Google Search Central
21 Welcome Note - Vivaik Bharadwaaj - Google India SearchMasters '09
Welcome Note - Vivaik Bharadwaaj - Google India SearchMasters '09
Google Search Central
22 Google Custom Search - Rajat Mukherjee - Google India SearchMasters '09
Google Custom Search - Rajat Mukherjee - Google India SearchMasters '09
Google Search Central
23 Building Mobile Friendly Websites - Ankit Gupta - Google India SearchMasters '09
Building Mobile Friendly Websites - Ankit Gupta - Google India SearchMasters '09
Google Search Central
24 Q & A with Adam Lasnik - Google India SearchMasters '09
Q & A with Adam Lasnik - Google India SearchMasters '09
Google Search Central
25 Webmaster Central and Best Practices - Adam Lasnik - Google India SearchMasters '09
Webmaster Central and Best Practices - Adam Lasnik - Google India SearchMasters '09
Google Search Central
26 Google Analytics and Website Optimizer - Deepak Kumar - Google India SearchMasters '09
Google Analytics and Website Optimizer - Deepak Kumar - Google India SearchMasters '09
Google Search Central
27 What are the factors that go into determining the PageRank of a Twitter page?
What are the factors that go into determining the PageRank of a Twitter page?
Google Search Central
28 Webmaster Tools spring time design refresh
Webmaster Tools spring time design refresh
Google Search Central
29 Can I publish 100+ pages at once?
Can I publish 100+ pages at once?
Google Search Central
30 Why is the @ character ignored in search queries?
Why is the @ character ignored in search queries?
Google Search Central
31 How can new pages get indexed quickly?
How can new pages get indexed quickly?
Google Search Central
32 Using a barcode scanner with Google Book Search
Using a barcode scanner with Google Book Search
Google Search Central
33 Behind the scenes of Google Webmaster Central videos
Behind the scenes of Google Webmaster Central videos
Google Search Central
34 Are shortened URLs treated differently than other redirects?
Are shortened URLs treated differently than other redirects?
Google Search Central
35 How can I make sure Google reaches my deeper pages?
How can I make sure Google reaches my deeper pages?
Google Search Central
36 What impact does server location have on rankings?
What impact does server location have on rankings?
Google Search Central
37 Will a "coming soon" page negatively impact my site?
Will a "coming soon" page negatively impact my site?
Google Search Central
38 How many pages can Google index from a single site?
How many pages can Google index from a single site?
Google Search Central
39 What if a search for my business triggers "Did you mean?"
What if a search for my business triggers "Did you mean?"
Google Search Central
40 Are CSS-based layouts better than tables for SEO?
Are CSS-based layouts better than tables for SEO?
Google Search Central
41 What impact does "page bloat" have on Google rankings?
What impact does "page bloat" have on Google rankings?
Google Search Central
42 What types of directories are seen as sources of paid links?
What types of directories are seen as sources of paid links?
Google Search Central
43 Should I include my logo text using 'alt' or CSS?
Should I include my logo text using 'alt' or CSS?
Google Search Central
44 What are some best practices for moving to a new CMS?
What are some best practices for moving to a new CMS?
Google Search Central
45 How gzip works
How gzip works
Google Search Central
46 Optimizing the order of scripts and styles
Optimizing the order of scripts and styles
Google Search Central
47 PHP performance tips
PHP performance tips
Google Search Central
48 Minimizing browser reflow
Minimizing browser reflow
Google Search Central
49 Improving website performance with Page Speed
Improving website performance with Page Speed
Google Search Central
50 Optional HTML tags
Optional HTML tags
Google Search Central
51 Optimizing web graphics
Optimizing web graphics
Google Search Central
52 Prefetching resources
Prefetching resources
Google Search Central
53 HTTP caching
HTTP caching
Google Search Central
54 Is over-optimization bad for a website?
Is over-optimization bad for a website?
Google Search Central
55 Interview with Adam Lasnik - Part 1
Interview with Adam Lasnik - Part 1
Google Search Central
56 Interview with Adam Lasnik - Part 2
Interview with Adam Lasnik - Part 2
Google Search Central
57 Interview with Adam Lasnik - Part 3
Interview with Adam Lasnik - Part 3
Google Search Central
58 Can the geographic location of a web server affect SEO?
Can the geographic location of a web server affect SEO?
Google Search Central
59 Will I be penalized if my URLs all have the same priority?
Will I be penalized if my URLs all have the same priority?
Google Search Central
60 How can I optimize my site on a small budget?
How can I optimize my site on a small budget?
Google Search Central

Related AI Lessons

Had my Frontend Developer interview with Capgemini (Application Developer) today, and I wanted to…
Prepare for a frontend developer interview with Capgemini by reviewing JavaScript fundamentals and practicing common interview questions
Medium · JavaScript
10 Frontend Developer Tools to Boost Productivity in 2026
Boost frontend productivity with 10 essential tools for modern web app development
Medium · Programming
10 Frontend Developer Tools to Boost Productivity in 2026
Boost frontend productivity with top 10 developer tools in 2026
Medium · JavaScript
The US Frontend Engineer Market in 2026: A Data-Driven Reality Check (and the Bias That Stops Us Seeing It)
US frontend engineer hiring demand peaked in 2022 and remains flat-depressed in 2026, contrary to common assumptions
Dev.to AI

Chapters (5)

Introduction
0:31 What happens when your browser opens a webpage
2:27 What are the rendered HTML and the DOM?
5:35 How to debug your page by viewing both the source and rendered HTML
7:30 Recap
Up next
The masks we wear | Zora Krstić | TEDxLuxembourgCity
TEDx Talks
Watch →