Frontend
In short
The frontend is the part of an application that runs in front of the user, usually in the browser, drawing the interface and responding to clicks and typing.
What is the frontend?
The frontend is everything a user sees and touches: the layout, text, buttons, forms and animations of a website or app, and the code that makes them respond. On the web it is built from HTML for structure, CSS for appearance and JavaScript for behavior, and it runs on the user's own device, inside the browser.
The frontend rarely holds the important data itself. When it needs something, such as a list of orders or a search result, it asks the backend through an API, usually over HTTP, and then shows the answer. Keeping the two apart lets each one change on its own: a redesign need not touch the server, and the same backend can serve a website and a mobile app.
Frontend work covers more than looks. It includes accessibility, so the interface works with a keyboard and screen readers; performance, so pages load quickly on slow phones; and state management, so what is on screen stays in step with the data. Frameworks such as React, Vue, Angular and Svelte help organize larger interfaces into reusable components.
Key takeaways
- The frontend is the user-facing part of an application, usually running in the browser.
- On the web it is built with HTML, CSS and JavaScript.
- It gets and changes data by calling the backend through APIs.
- Good frontend work includes accessibility and performance, not only appearance.
Example
// Runs in the browser: ask the backend for data, then show it
const response = await fetch("/api/orders");
const orders = await response.json();
const list = document.querySelector("#orders");
for (const order of orders) {
const item = document.createElement("li");
item.textContent = `Order ${order.id}: ${order.total}`;
list.append(item);
}Readers ask
What is the difference between frontend and backend?
The frontend is the part users interact with, running on their device, while the backend runs on servers and handles data, business rules and security. The frontend asks and the backend answers, usually through an API.
Is the frontend only about design?
No. Designers decide how an interface should look and behave, and frontend developers build it in code, which includes making it fast, accessible on every device, and correct when the data changes.
Do mobile apps have a frontend?
Yes. The screens of an iOS or Android app are its frontend, built with tools such as SwiftUI, Jetpack Compose, React Native or Flutter, and they talk to a backend the same way a website does.
Often compared
See also
- BackendBackend & APIs, p. 5The backend is the server side of an application: the code, databases and services that store data, apply business rules and answer the frontend's requests.
- HTMLWeb Development, p. 18HTML is the markup language that defines the structure and content of web pages, such as headings, paragraphs, links, images, and forms.
- CSSWeb Development, p. 10CSS is the style sheet language that controls how HTML content looks on screen, including colors, fonts, spacing, layout, and animations.
- JavaScriptWeb Development, p. 24JavaScript is the programming language that runs in web browsers to make pages interactive, and it also runs on servers through runtimes like Node.js.
- Web BrowserWeb Development, p. 57A web browser is an application that fetches web pages from servers and turns their HTML, CSS, and JavaScript into the interactive pages you see on screen.
- APIBackend & APIs, p. 2An API is a set of rules that lets one piece of software request data or actions from another in a predictable, documented way.
- ReactWeb Development, p. 36React is an open-source JavaScript library for building user interfaces from reusable components that update automatically when their data changes.
- SPAWeb Development, p. 41An SPA is a web application that loads a single HTML page and then updates content with JavaScript, so moving between views does not reload the page.
- UI ComponentWeb Development, p. 51A UI component is a self-contained, reusable piece of an interface, such as a button, a form or a card, that bundles its markup, style and behavior.
Spotted a mistake or something missing on this page?Suggest an edit