There is no one code used to build a website: a typical site combines HTML for structure, CSS for presentation, and JavaScript for behavior in the browser, plus a server-side language and a database query language behind the scenes if the site is dynamic. Which of those you actually write depends on what the site must do, and many modern sites are assembled with frameworks and content systems that generate or hide some of that code. The question is ambiguous in a useful way—"code" can mean the markup a browser renders, the programming language a developer writes, or the source of a site builder—so the honest answer names the layers and then narrows them to the case at hand.
The three languages every browser-facing page relies on
HTML (HyperText Markup Language) is not a programming language in the usual sense; it is a markup language that labels content: headings, paragraphs, links, images, form fields. A minimal page is still recognizably HTML:
CSS (Cascading Style Sheets) controls appearance—color, spacing, layout, responsive behavior at different screen widths. It is a stylesheet language, not a general-purpose programming language, though it has variables, functions, and increasingly complex selectors. JavaScript is the language browsers execute; it handles interactivity, network requests, and much of what users perceive as an "app." These three are the irreducible client-side trio for a hand-built site.
Two clarifications prevent common confusion. First, "HTML is code" is true in the everyday sense of source text a browser parses but misleading if it implies logic and computation. Second, JavaScript and Java are different languages with different histories and uses; the shared "Java" syllable is a naming coincidence, not a family relationship. TypeScript is a separate language that compiles to JavaScript and adds static typing; it is increasingly common in larger front-end codebases.
Server-side code: what runs before the page reaches the browser
If a site only serves fixed files, no server-side programming is required. Static sites—documentation, portfolios, brochures—can be complete with HTML, CSS, and maybe a little JavaScript, hosted on any file server or content delivery network.
Dynamic sites need code that runs on a server (or at the edge) to assemble responses: reading a database, checking a login, processing a payment, personalizing content. Common server-side languages include Python, JavaScript/Node.js, PHP, Ruby, Java, C# (.NET), Go, and others. The choice is usually organizational and ecosystem-driven rather than a property of "websites" in general.
A minimal server example in Node.js shows the shape of it—receiving a request and returning HTML:
The equivalent idea appears in every server language: accept a request, decide what to return, send a response. The language is a tool; the pattern is the concept.
Behind many dynamic sites sits a database, queried with SQL (for relational databases such as PostgreSQL, MySQL, or SQLite) or with a database-specific API (for document stores such as MongoDB). SQL is a query language, not a general-purpose programming language, and it is typically embedded in or called from the server-side code rather than replacing it.
Frameworks, build tools, and what "built with" usually means
In practice, developers rarely write raw HTML, CSS, and JavaScript by hand for a large site. They use frameworks and tooling, and this is where the question "which code" gets slippery.
On the front end, frameworks such as React, Vue, Svelte, and Angular let developers write components in JavaScript or TypeScript; the framework produces the HTML the browser receives. CSS may be written directly, in preprocessors such as Sass, or in utility-based systems such as Tailwind CSS. Build tools (Vite, webpack, and similar) bundle and optimize assets. On the back end, frameworks such as Django (Python), Rails (Ruby), Laravel (PHP), Spring (Java), and ASP.NET (C#) provide structure, routing, and database access.
A useful distinction: the language is what a person writes; the framework is a library and convention set in that language; the output is what the browser ultimately parses. Asking "what code is a website built with" can mean any of the three, and answers that name only one layer are incomplete rather than wrong.
Content management systems and site builders add another layer. WordPress is written primarily in PHP and powers a large share of the web; users often write no PHP at all, configuring themes and plugins and perhaps editing HTML fragments. Squarespace, Wix, and similar hosted builders generate the underlying markup themselves; the user's "code" is configuration and content. Static site generators such as Hugo, Jekyll, and Eleventy take Markdown and templates and produce HTML files at build time. In each case, the visible site is HTML, CSS, and JavaScript, but the author's input is at a different level of abstraction.
How to decide which answer applies to your situation
The right framing depends on the goal:
Learning what makes a page work: start with HTML, then CSS, then JavaScript. This trio is the foundation regardless of what frameworks you later adopt. Building a simple informational site: HTML/CSS plus a static host may be sufficient; no server language is required. Building an interactive application with accounts and data: you will need a server-side language (or a backend-as-a-service), a database, and a front-end framework or plain JavaScript, depending on scale. Editing an existing site: identify the platform first. A WordPress site's customization is mostly PHP-adjacent templating and CSS; a React site's is JavaScript/TypeScript components; a Squarespace site's is the builder's settings. Asking what a specific site uses: that requires inspecting its delivered files, response headers, or public documentation—evidence this answer cannot supply, and a question distinct from "what code builds websites in general."
A common counterexample to any single-language answer: a modern web application might use TypeScript on both client and server, a SQL database, CSS generated from Sass, and HTML produced by a framework—four or five languages and formats in one project. Conversely, a single static HTML file with inline CSS uses one. Both are websites; neither makes the other's description false.
Where the confusion comes from
Three ambiguities drive most of the muddle. First, "code" is used both for markup and for program logic, so HTML gets called code while being structurally different from Python. Second, "build" suggests construction from raw materials, but most sites are assembled from frameworks, templates, and dependencies, so the developer's contribution is a fraction of the bytes served. Third, "website" spans a one-page document and a distributed application with mobile clients, and the appropriate stack differs enormously across that range.
A related distinction worth keeping: client-side code runs in the user's browser (HTML, CSS, JavaScript, and things that compile to them); server-side code runs where the site is hosted. The same language can appear on both sides—JavaScript via Node.js is the clearest example—but the execution environment and security assumptions differ sharply. Confusing the two leads to errors such as assuming that hiding a password check in client-side JavaScript secures anything; it does not, because the user can read and modify that code.
For register and usage: "Which code is used to build a website?" is natural informal English, and the usual reply names the trio and then qualifies. More precise phrasings include "What languages and frameworks is this site built with?" and "What is the site's tech stack?" The latter term, "stack," is the standard shorthand for the combination of languages, frameworks, servers, and databases—for example, a "LAMP stack" (Linux, Apache, MySQL, PHP) or a "Jamstack" (JavaScript, APIs, and prerendered markup). These labels are conventions rather than formal standards, and their boundaries shift over time, so treat them as descriptive shorthand.
The short answer, then, holds up under scrutiny: HTML, CSS, and JavaScript for what the browser renders; a server-side language and often a database behind dynamic behavior; and frameworks, CMSs, or builders layered on top depending on how the site is made. What remains unknown without specifics is which of those a given site actually uses—and that is a question about evidence, not about the general rule.