Can you create a website without web hosting?

You can build and preview a website without paying for traditional hosting. A local development environment runs the site on your own computer, which is useful for design, development, and testing. Other people cannot normally open that local site unless you deliberately expose it through a temporary sharing service.
Free website builders and publishing platforms also let you place a site online without buying a separate hosting plan. The platform provides the servers as part of its service. Free plans often use a platform subdomain, display branding, limit storage, or restrict features. The site is still hosted; the hosting is simply included and controlled by the platform.
Static hosting services can publish HTML, CSS, and JavaScript at little or no cost. They work well for portfolios, documentation, and simple landing pages. A dynamic site that uses server-side code, a database, user accounts, or online payments needs services that support those functions, even if the provider calls the plan a free tier.
Choose based on what happens after the first version is ready. A local site is suitable for private work, while a public site needs an online service that can deliver it reliably. Check whether the chosen option supports a custom domain, HTTPS, backups, traffic growth, data export, and the features the project will need later.