<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How a Browser Works ?]]></title><description><![CDATA[How a Browser Works ?]]></description><link>https://how-a-browser-works-by-anunay.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 00:10:53 GMT</lastBuildDate><atom:link href="https://how-a-browser-works-by-anunay.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How a Browser Works: A Beginner-Friendly Guide to Browser Internals]]></title><description><![CDATA[What Happens After I Type a URL and Press Enter?
This is one of the most important questions in web development. You type a URL, press Enter, and a webpage appears. But behind the scenes, the browser is doing a lot of work.A browser is not just somet...]]></description><link>https://how-a-browser-works-by-anunay.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</link><guid isPermaLink="true">https://how-a-browser-works-by-anunay.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</guid><category><![CDATA[Browsers]]></category><category><![CDATA[working of browser]]></category><category><![CDATA[DOM]]></category><category><![CDATA[cssom]]></category><category><![CDATA[Render-tree]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Anunay Abhishek]]></dc:creator><pubDate>Fri, 30 Jan 2026 14:57:33 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-happens-after-i-type-a-url-and-press-enter">What Happens After I Type a URL and Press Enter?</h2>
<p>This is one of the most important questions in web development. You type a URL, press Enter, and a webpage appears. But behind the scenes, the browser is doing a lot of work.A browser is not just something that opens websites. It is a complex system of components that work together to turn code into pixels on your screen.</p>
<h2 id="heading-what-is-a-browser-really">What Is a Browser, Really?</h2>
<p>A <strong>web browser</strong> is a program that fetches files from the internet (HTML, CSS, JavaScript) , Understands those files and then convert them into a <strong>visible webpage</strong> you can interact with. Examples of browsers: Chrome, Firefox, Edge, Safari. All of them follow <strong>the same basic process</strong>, even if their internals differ slightly.</p>
<h2 id="heading-main-parts-of-a-browser">Main Parts of a Browser</h2>
<p>At a high level, a browser is made of several key parts:</p>
<ol>
<li><p><strong>User Interface (UI)</strong></p>
</li>
<li><p><strong>Browser Engine</strong></p>
</li>
<li><p><strong>Rendering Engine</strong></p>
</li>
<li><p><strong>Networking</strong></p>
</li>
<li><p><strong>JavaScript Engine</strong></p>
</li>
</ol>
<h2 id="heading-user-interface-ui">User Interface (UI)</h2>
<p>This is the part <strong>you directly interact with</strong>. It includes has Address bar, Back/Forward buttons, Refresh Buttons, Tabs. The UI takes your input (like typing a URL) and passes it to the browser engine.</p>
<h2 id="heading-browser-engine-vs-rendering-engine">Browser Engine vs Rendering Engine</h2>
<ul>
<li><p><strong>Browser Engine</strong> → It acts like a coordinator.</p>
</li>
<li><p><strong>Rendering Engine</strong> → It draws the webpage.</p>
</li>
</ul>
<p>The browser engine tells the rendering engine <strong>what content to load and display</strong>.</p>
<h2 id="heading-networking-fetching-website-files">Networking: Fetching Website Files</h2>
<p>Once you press Enter the browser sends a request to the server and then the server responds with files of HTML, CSS, JavaScript, Images. This fetching of data happens through the browser’s <strong>networking layer</strong>.</p>
<h2 id="heading-html-parsing-and-dom-creation">HTML Parsing and DOM Creation</h2>
<p>When the browser receives HTML, it does <strong>not</strong> display it immediately. Firstly, it <strong>parses</strong> the HTML.</p>
<h3 id="heading-what-is-parsing">What Is Parsing?</h3>
<p>Parsing means <strong>breaking something into smaller meaningful pieces.</strong></p>
<h4 id="heading-simple-math-example">Simple Math Example</h4>
<pre><code class="lang-xml">2 + 3 * 4
</code></pre>
<p>The computer doesn’t see this as text. It breaks it into a structure , that structure helps it understand its meaning.</p>
<pre><code class="lang-xml">   +
  / \
 2   *
    / \
   3   4
</code></pre>
<h3 id="heading-html-dom">HTML → DOM</h3>
<p>Similarly, HTML is broken down into a <strong>tree structure</strong> called the <strong>DOM</strong> (Document Object Model).</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Hello<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Welcome<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
</code></pre>
<p>It is similar to:</p>
<pre><code class="lang-xml">body
 ├── h1
 └── p
</code></pre>
<h2 id="heading-css-parsing-and-cssom-creation">CSS Parsing and CSSOM Creation</h2>
<p>CSS is also parsed by the browser. The browser creates another tree-like structure called the <strong>CSSOM</strong> (CSS Object Model).</p>
<h3 id="heading-example">Example</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">color</span>: blue;
}
</code></pre>
<p>This tells the browser which element to style and what styles do we have to apply to them.</p>
<h2 id="heading-how-dom-and-cssom-come-together">How DOM and CSSOM Come Together</h2>
<p>The browser combines DOM for structures and CSSOM for styles. To create something called the <strong>Render Tree</strong>.</p>
<h3 id="heading-render-tree">Render Tree</h3>
<p>The render tree contains only visible elements and has information about how the elements should look.</p>
<h2 id="heading-layout-reflow-painting-and-display">Layout (Reflow), Painting, and Display</h2>
<p>Once the render tree is ready, the browser performs these steps:</p>
<h3 id="heading-1-layout-reflow">1. Layout (Reflow)</h3>
<p>Calculates size and position of each element and decides where the elements should go on the screen.</p>
<h3 id="heading-2-painting">2. Painting</h3>
<p>It is used to fill coolers and to draw text, borders, images.</p>
<h3 id="heading-3-display">3. Display</h3>
<p>Pixels are shown on the screen</p>
<h2 id="heading-full-browser-flow">Full Browser Flow</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769784883436/5963e93d-eece-44fc-aec5-bbd72c976945.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item></channel></rss>