# Understanding How Browser Works:

have you ever think that what happens what you write a URL on browser and click enter? The multi command process of million lines of code how does it render on your screen within milliseconds. In this blog I will tell you how does this process happens beyond your screen.

## <mark>What is browser :</mark>

A browser is simply **s**oftware that lets you access, view, and interact with websites on the Internet. what browser does?

> What browser does ?
> 
> * It fetches data from web servers when you enter a URL
>     
> * it downloads files such as HTML, images, text, video, etc., using protocols like HTTP/HTTPS.
>     
> * it parser those files and render it on display .
>     
> * it lets client to navigate in web page
>     

## <mark>Main parts of Browser :</mark>

1. **UI (User Interface)** : Ye woh parts hain jinke saath user interact karta hai. like tabs , address bars, navigation bar, bookmark bar, menu, settings etc.
    
2. **Browser Engine**: UI aur rendering engine ke beech **bridge** ka kaam karta hai. Decide karta hai **kab**, **kaise** page load hoga.
    
3. **Rendering Engine** : Ye engine code k**o** webpage me convert karta hai.
    
4. **javascript engine**: Website ka logic & interactivity yahin run hoti hai.
    
5. **Networking layer**: Internet se baat karne ka kaam karta hai.
    
6. **Disk api** : Browser locally data store karta hai for speed & convenience.
    

## <mark>Networking: how a browser fetches HTML, CSS, JS</mark>

For now I will explain this in diagrammatic matter . read that image carefully to understand how browser works.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769705699508/7eaf1ea5-2f62-43ab-91bd-204c7ab1553f.png align="center")

## <mark>DOM &amp; CSSOM creation:</mark>

Dom is created while parsing HTML files and CSSOM is created while parsing CSS files. both works together while rendering inside browser. This 2 DOM and CSSOM meets inside render tree where their workflow is designed . after render tree the final frame is get constructed and then reflow and painting occurs then then the website is get displayed to user.

---

***<mark>Thank you for reading . Have a happy learning journey. I hope this article added some value for your given precious time.</mark>***
