Frontend vs backend: what's the difference?
The frontend is the part of an app you see and use in your browser: pages, buttons and forms. The backend runs out of sight on a server, storing data and doing the work you ask for.
Last updated
What each one means
Side by side
| Frontend | Backend | |
|---|---|---|
| Where it runs | In your browser or app, on your own device | On a server, out of sight |
| What it does | Shows things and reacts to taps and clicks | Stores data, checks rules and does the heavy work |
| Who sees it | Everyone who visits | Only the people who build and run the app |
| Built with | HTML, CSS and JavaScript | Languages like JavaScript, Python, Java or PHP, plus a database |
| Can it keep secrets? | No. Anyone can read the code their browser receives. | Yes. Keys and passwords stay on the server. |
| In a restaurant | The dining room and the menu | The kitchen and the pantry |
An example: buying a book online
You search for a title, tap the cover and press Add to basket. All of that happens in the frontend. When you pay, the backend checks your card with a payment service, takes the book out of stock in the database and sends your confirmation email. You only see the result: a thank-you page, drawn by the frontend.
See the frontend: flip the switches
The toy bakery page is pure frontend. Switch off CSS to strip its looks, switch off JavaScript to stop its buttons reacting, or shrink it to phone size. Everything you change happens in your browser.
Switches
Fresh bread, baked at 6am
Order by 10am, collect after lunch.
Sourdough loaf
£4.00
Cinnamon bun
£2.50
Lemon cake
£3.00
This whole page is frontend. Flip the switches one at a time to see what each building block does.
See the backend: follow an order
In the restaurant, the menu is the frontend and the kitchen is the backend. Place an order and watch it leave the dining room, get cooked out of sight and come back as food, or as a sold-out note.
Menu
the frontend
Waiter
the API
- This lesson
Kitchen
the backend
Pantry
the database
Choose an order above, then follow it step by step through the restaurant.
Common questions
What does full-stack mean?
Working on both the frontend and the backend. A full-stack developer can build the pages people see and the server work behind them.
Is the database part of the backend?
Yes. The database is where the backend keeps its data, like users and orders. Visitors never talk to it directly; the backend does that for them.
Do AI app builders make the backend too?
Many now do. Tools that build an app from a description often set up a database and log-in for you, but you still need to check what they made.