To build a website with AI, write a one-page brief, ask an AI assistant to generate a static site as plain HTML and CSS files, open it in your browser, fix what is wrong by describing the problem, and upload the folder to a host such as Cloudflare Pages. A first small site takes an afternoon, and the quality depends mostly on how clear your brief is and how carefully you check the result.
This guide uses a static site: a folder of files with no server code, no database and no login. It is the easiest kind for an AI to get right and the easiest for you to verify. The same steps work with a chat assistant (you copy files out of the chat) or a coding agent that writes files directly into a folder.
Step 1: Write the brief before you open the AI
The AI cannot guess what your site is for. The Claude Code documentation frames this as telling the model what it can't see, and for a new site that means everything. Write down five things in plain text:
- Purpose and audience. "A one-page site for a dog-walking service in a small town. Visitors want prices, the area covered and a way to get in touch."
- Pages. List them. Start with one to three: home, about, contact.
- Real content. Paste your actual text, prices, opening hours and address. If you leave gaps, the AI invents plausible filler, and invented prices or claims on a live site are your problem.
- Look and feel. Two or three colours as hex codes, light or dark background, one or two adjectives. Name a website you like if it helps.
- Constraints. "Plain HTML and CSS only, no frameworks, no external scripts, no build step, works on a phone."
The last constraint matters. Without it, assistants often produce a project that needs Node.js, a package install and a build command. You asked for a website, and a folder of files you can double-click is much simpler to debug.
Step 2: Ask for the files, not just a page
Paste your brief and ask for a complete, working result. A prompt you can adapt:
Build a static website from the brief below.
Output separate files: index.html, about.html, contact.html and styles.css.
Rules: plain HTML and CSS only, no JavaScript, no external fonts or CDNs,
mobile-first layout, semantic elements (header, nav, main, footer),
every image has alt text, every page has a title and a meta description.
Use only the text I provide. If something is missing, put the word TODO
in the page instead of inventing it.
BRIEF:
[paste your brief and content here]
The "TODO instead of inventing" rule makes gaps easy to find later: you can search the files for the word and fill each one in. If you use a chat assistant, save each file with exactly the name it gives, all in one new empty folder. If you use an agent that writes files itself, point it at that empty folder.
Step 3: Check the HTML skeleton
You do not need to read every line, but confirm that each page has the standard structure. MDN's minimal page looks like this:
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>My test page</title>
</head>
<body>
...
</body>
</html>
What to look for, according to MDN:
<html lang="...">sets the page's primary language.<meta charset="utf-8" />makes accented letters and symbols display correctly. MDN says there is no reason not to set it.- The viewport meta tag stops mobile browsers from rendering the page wider than the screen and then shrinking it. Many pages use
width=device-width, initial-scale=1; either way, a missing viewport tag is a common reason a site looks tiny on a phone. <title>is the text in the browser tab and in bookmarks. Each page should have its own.- A
<meta name="description">is a short, accurate summary of the page. MDN notes that search engines such as Google use it to adjust how the page appears in results.
If a page is missing any of these, tell the AI which one and which file.
Step 4: Open it and test it like a visitor
Double-click index.html. It opens in your default browser from your own disk, with no server involved. Then check:
- Phone width. In Chrome or Edge press F12, then the device toolbar button (or Ctrl+Shift+M). Pick a narrow width such as 375 px. Text should not overflow, buttons should be tappable, and nothing should need sideways scrolling.
- Every link. Click each menu item and each button. Relative links between your own files break easily if the AI used a different file name in the link than it used for the file.
- Every image. A broken image icon means the file is missing or the name does not match. AI assistants cannot create your photos; they reference file names that you must supply.
- Every fact. Read the page against your brief. Check prices, phone numbers, email addresses and opening hours character by character.
- Search for TODO. Any hit is content you still owe the page.
The Claude Code docs recommend giving the model a check it can run rather than relying on you as the only verification. For a website, the practical version is to describe what you saw: "On a 375 px wide screen the menu links overlap the logo" is a fix request the AI can act on. "It looks off" is not.
Step 5: Fix problems one at a time
Describe the symptom, name the file and say what you expected. Ask for one change per message, then re-test. If a long conversation starts producing worse and worse edits, start a fresh chat, paste the current files and continue from there. The coding workflow in how to use AI for coding covers why long sessions degrade and how to restart cleanly.
Two habits save time. Keep a copy of the folder before each big change, so you can go back. And when an edit comes back, make sure the AI changed only what you asked: assistants sometimes rewrite whole files and quietly drop a section. The checklist in how to review AI-generated code applies to HTML too.
Step 6: Publish it
A site on your disk is visible only to you. A host serves the folder to everyone. Cloudflare Pages offers two routes, both documented by Cloudflare.
Option A: Drag and drop
In the Cloudflare dashboard open Workers & Pages, then select Create application, Get started, Drag and drop your files. Enter a project name, drag in your folder and select Deploy site. The site is served from <PROJECT_NAME>.pages.dev.
Option B: Wrangler command line
With Node.js installed, Cloudflare's Direct Upload docs give these two commands:
npx wrangler pages project create
npx wrangler pages deploy <BUILD_OUTPUT_DIRECTORY>
The first asks for a project name and a production branch. The second uploads the folder you name. Wrangler needs a single folder of assets, and zip files are not supported. Cloudflare also notes that a Direct Upload project cannot be switched to Git integration later, so if you plan to keep the site in a Git repository, choose the Git route instead.
If the pages.dev address returns a 404 error, check that the top level of your upload contains a file named exactly index.html: Cloudflare says Pages serves it at the root.
After publishing, open the live address on your phone, not only your computer, and repeat the Step 4 checks. Problems that did not show locally, such as a wrong file name in different letter case, show up here.
What AI does badly when building websites
| Problem | What it looks like | What to do |
|---|---|---|
| Invented content | Made-up testimonials, prices, team names, statistics | Supply real text; ban inventions in the prompt; read every line |
| Missing images | Broken image icons, or links to stock photos you do not have rights to | Use your own images and give the AI the file names |
| Wrong file names in links | Clicking a menu item shows a "file not found" page | Click every link; ask the AI to list all file names and links |
| Over-built project | Needs npm, a framework or a build step | State "plain HTML and CSS, no build step" up front |
| Forms that do nothing | A contact form with no place to send data | A static site cannot receive form data on its own; use a plain mailto: link or a form service you have chosen |
Before you promote the site
Google's guidance on generative AI content is direct: it expects you to "manually factcheck and review all AI-generated content for accuracy and trustworthiness before publishing", including metadata such as titles, descriptions and image alt text. It also says that using AI tools to generate many pages without adding value for users may violate its policy on scaled content abuse. For a personal or small-business site, that points to a simple rule: publish a few pages that say true, specific things, rather than dozens of near-identical ones.
Google also suggests telling readers how the content was made where that helps them. A short note such as "drafted with AI assistance and checked by the owner" is honest, and it is your decision whether it fits your site.
If your site will ever collect personal data, take payments or let people log in, stop treating it as a beginner exercise. Those features need security knowledge that you must be able to verify yourself, and a generated result that "seems to work" is not proof that it is safe.
Frequently asked questions
- Can AI build a whole website for me with no coding?
- For a small static site (a few pages of text, images and links), yes: an AI assistant can write all the HTML and CSS from a plain-language brief. You still have to open the result, check it on a phone-sized window, fix what is wrong, and publish it. Anything with logins, payments or a database needs real programming knowledge to check.
- Do I need to know HTML to build a website with AI?
- No, but a little helps you spot problems. Knowing that a page has a head and a body, that images need alt text and that links need a destination lets you review what the AI wrote. The MDN beginner pages cover those basics in under an hour.
- Will Google rank a website that AI wrote?
- Google says it does not penalise content only because AI produced it. Its guidance does warn that using AI to generate many pages without adding value for users may break its spam policy on scaled content abuse, and it tells publishers to fact-check and review AI-generated content before publishing.
- What is the difference between a static site and a dynamic site?
- A static site is a set of ready-made files (HTML, CSS, images) that a host sends to the browser unchanged. A dynamic site runs code on a server for each visit, for example to check a password or read a database. Static sites are simpler to build with AI and to host, so they are the right place to start.
- How do I change the site after it is live?
- Edit the files locally, ask the AI for the change, check it in your browser, then upload the folder again. With Cloudflare Pages Direct Upload, running the same deploy command again publishes a new version.