Uni-Sine
AI
+25XP
AIUsing AI

How to build a website with AI

Three ways to build a website with AI

ApproachHow it worksBest forWatch out for
AI website builderAnswer a few questions and the builder generates a site from templatesA simple business or portfolio site, fastLess control, and you are tied to that platform
Chat assistantAsk a chatbot for the code, then copy it into files yourselfSmall pages and learning how the code worksCopying and pasting gets slow and error-prone as the site grows
Coding agentAn AI that works inside your editor or terminal, reads your project and edits the files directlyReal projects you want to own and keep improvingYou must review what it changes

This guide follows the coding agent route, because it gives you a real website you fully own. The same habits help with the other two. Our AI Websites course walks through every step with practice.

Step 1: write a short spec

Your first prompt is a specification. A vague request like "make me a website" gets a generic result. Say who the site is for, what pages it needs, what each page should contain, the style you want and any technical choices.

Build a one-page website for a dog-walking business in Leeds.
Sections: hero with the business name and a booking button,
services with prices, three customer reviews, and a contact form.
Style: friendly, green and white, large readable text, works on phones.
Use plain HTML, CSS and JavaScript in separate files. No frameworks.

Step 2: set up a project folder

Create an empty folder for the site and open it in your editor or terminal with the coding agent. Many agents also read an instructions file in the project on every session, where you can put lasting rules such as "use British spelling" or "keep files under 300 lines".

Step 3: read the plan before it builds

Ask the agent to describe its plan first: which files it will create and what goes in each. Fixing a misunderstanding in the plan takes seconds; fixing it after hundreds of lines are written takes much longer. Try it: this question shows an agent's plan and asks whether it matches the request.

Pick the plan step that goes beyond the request.

Press Mark to have your answer marked in the Make Websites with AI course.

Step 4: review every change

Coding agents show each change as a diff: lines removed in red and lines added in green. Read them before accepting. Check the change does what you asked, doesn't touch unrelated files, and doesn't add anything you don't understand. Try one: this question shows a change and asks whether to accept or reject it.

Accept or reject each diff against what was asked.

Press Mark to have your answer marked in the Make Websites with AI course.

Step 5: run it and refine

  • Open it in a browser on your own computer and click through every page, on a phone-sized window too.
  • Ask for one change at a time, worded precisely: "Make the booking button larger and move it above the photo" works better than "make it better".
  • Show, don't describe: paste a screenshot or the exact error message rather than describing the problem.
  • Learn the basics as you go. Knowing a little HTML and CSS makes it much easier to spot when the AI gets something wrong; our guide to HTML is a good start, and you can experiment in the Code Editor.

Step 6: save checkpoints

Use version control, usually Git, and commit each time the site works. A commit is a checkpoint: if a later change breaks something, you can go straight back to the last working version instead of untangling it.

Step 7: keep secrets out and put it online

If the site uses a service with an API key, such as a payment or email service, keep the key in an environment file on the server, never in the website's code, where any visitor could read it. Our guide to API keys explains why. Then publish the site with a hosting service; for a simple site of HTML, CSS and JavaScript files, many hosts offer a free tier, and some can publish straight from your Git repository.

Common mistakes

  • Starting with a one-line prompt. A clear spec saves many rounds of fixes.
  • Accepting every change without reading it. Agents can misunderstand, overreach or break working parts.
  • Asking for many changes at once. One focused request at a time is easier to check and undo.
  • Never committing. Without checkpoints, one bad change can cost hours.
  • Pasting secrets into prompts or code. Keep keys in environment variables.
  • Skipping phone testing. Most visitors will see the site on a phone.

Common questions

Can AI build a website for me?
Yes. AI builders, chat assistants and coding agents can all produce working websites. You still need to describe what you want clearly, check the result and test it.
Do I need to know how to code to build a website with AI?
Not to get started, but basic HTML and CSS help a lot. They let you understand what the AI made and spot mistakes.
What is the difference between a chat assistant and a coding agent?
A chat assistant gives you code to copy into files yourself. A coding agent works inside your project, reads the files and makes the changes directly, which you then review.
Is a website built with AI safe?
It can be, if you review the code, keep secrets out of it, and keep dependencies up to date. AI can write insecure code just as people can, so checking matters.
How long does it take to build a website with AI?
A simple one-page site can be working in an hour or two. A bigger site with forms, accounts or payments takes longer, mainly for testing and refining.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Code Editor

    Write and run code right in your browser

    Open the tool
  • Learn it

    Make Websites with AI

    Set up an AI coding agent and ship a real website, start to finish

    Start the course
Read next
AI · CoursesBuild a website with AI: a step-by-step courseLearn to build a website with AI in 32 short sections: pick a coding agent, write a spec, review its changes, fix errors, use git and go live.