Skip to content
AITermsLab
–points–day streak

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

Frontend
The frontend is everything you see and interact with on a website or app: the text, buttons, pictures and layout on your screen.
Backend
The backend is the part of an app that runs out of sight on another computer, doing the work you asked for and keeping the data.

Side by side

Frontend compared with Backend
FrontendBackend
Where it runsIn your browser or app, on your own deviceOn a server, out of sight
What it doesShows things and reacts to taps and clicksStores data, checks rules and does the heavy work
Who sees itEveryone who visitsOnly the people who build and run the app
Built withHTML, CSS and JavaScriptLanguages 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 restaurantThe dining room and the menuThe 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.

Screen size

Switches

rosas-bakery.example
Rosa's Bakery
Basket (0)

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.

Choose an order
  1. Menu

    the frontend

  2. Waiter

    the API

  3. This lesson

    Kitchen

    the backend

  4. 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.