How to build a website with ChatGPT or Codex, with no coding
You can build a real, fast website with ChatGPT or OpenAI Codex without writing code yourself. This guide walks through the whole process: writing the brief, getting a first version, improving it, and putting it live on your own domain. It also covers the mistakes that trip most beginners up.
Before you start: chat or Codex?
There are two ways to do this with OpenAI's tools, and you can use either.
- ChatGPT (chat): best for a one-page or few-page site. It writes the code in the conversation; you copy it into a file. Works on the free plan, though you'll hit limits faster.
- Codex: OpenAI's coding agent. It works inside a project folder (on your computer, or in the cloud linked to a GitHub repository), creates and edits the files itself and can check its own work. Better once your site has several pages, a form or anything interactive. Codex is included with ChatGPT's paid plans, and OpenAI has also offered limited free access.
The same approach works with Claude, Grok or Cursor. Only the buttons differ.
Step 1: write a proper brief
Most bad AI websites come from a one-line request. Spend ten minutes writing a short brief instead. Include:
- Who it's for: "Dog owners in Tamworth looking for a reliable walker."
- What visitors should do: "Call me or send an enquiry."
- The sections: hero with headline, services and prices, about me, reviews, area covered, contact form, footer.
- The feel: "Friendly, clean, lots of white space, green accents, no stock-photo clichés."
- The real content: your actual business name, prices, phone number and opening hours. AI fills gaps with made-up details, so give it the facts.
- Technical rules: "A single index.html with the CSS inside it, no frameworks, mobile-first, fast, accessible."
Paste that into ChatGPT and finish with: "Before you write any code, ask me up to five questions about anything unclear." That one line removes most of the guesswork. For more on this, see how to write prompts for building apps.
Step 2: get the first version
Answer its questions, then ask for the full file. In chat, copy the code into a plain text editor (Notepad, TextEdit in plain-text mode, or the free VS Code) and save it as index.html. Double-click it and it opens in your browser. That's your website, running on your own computer.
With Codex, create an empty folder (or an empty GitHub repository), open it in Codex and give it the same brief. It will create the files directly. Ask it to "explain what you created and how to preview it."
Step 3: improve it in small, specific steps
Now test like a fussy customer. Look at it on your phone (your browser's developer tools have a phone preview, or simply email the file to yourself). Then ask for one or two changes at a time:
- "On mobile the menu covers the headline. Make the menu collapse into a button below 700px wide."
- "The prices table is hard to read. Turn it into three cards side by side, stacking on mobile."
- "Replace the placeholder reviews with these three real ones: …"
In chat, always ask for the complete updated file rather than fragments, so you don't paste bits into the wrong place. In Codex, check what changed after each request. Small steps mean you always know which change broke something.
Step 4: make the contact form actually work
A form on a plain HTML page can't send email on its own. The easiest beginner options are form services such as Formspree or FormSubmit, which forward submissions to your inbox; you point the form at their address and they handle delivery. Ask the AI: "Wire this form up to Formspree. Show me exactly where I paste my form ID." Then test it with a real submission. Check the privacy side too: tell visitors what you do with their details, and link a short privacy policy. Under UK GDPR that's expected even for a small site.
Step 5: put it live on your own domain
For a static site (HTML, CSS, images), hosting can be free:
- Buy a domain. A
.co.ukusually costs a few pounds a year at cost-price registrars such as Cloudflare, and more at the big-brand registrars, especially on renewal. - Create a free Cloudflare account, go to Workers & Pages, create a Pages project and choose direct upload. Drag in your site folder. Cloudflare gives you a free
.pages.devaddress straight away. - Add your custom domain in the project settings and follow the DNS steps. If your domain is registered with Cloudflare, it's a couple of clicks.
Netlify and GitHub Pages work in much the same way. Once your site is on GitHub, you can set it up so every change you save goes live automatically. Ask Codex to set that up for you and explain each step.
Step 6: the checks most beginners skip
- Every link and button works, including phone links (
tel:) and email links. - Page title and description are set, so the page looks right in Google and when shared.
- Images are compressed, ideally WebP, so the page loads fast on mobile data.
- No secret keys in the page. Anything in your HTML is public. Never paste API keys or passwords into front-end code.
- Accessibility basics: readable text contrast, alt text on images, labels on form fields. Ask the AI to "audit this page for accessibility and fix the issues."
- Facts are yours. Remove any made-up review, statistic or award the AI slipped in. Publishing fake reviews is unlawful in the UK.
Common problems and quick fixes
- "The AI keeps changing things I didn't ask for." Add: "Only change what I've asked for. Keep everything else exactly as it is."
- "It looks generic." Give it two or three sites you like and describe what you like about them: spacing, fonts, colours. Don't ask it to copy them.
- "The code got cut off." Ask it to continue from the last line, or split the site into separate CSS and HTML files.
- "Something broke and I don't know why." Go back to your last working version. This is why saving versions, or using GitHub, matters.
How long does it take?
A simple one-page site usually takes a beginner an evening or two, including going live. A multi-page site with a working form and your own domain takes a weekend. Your second site will take half the time, because the slow part is learning to describe and test, not the AI's typing.
New to all this? Start with what vibe coding is, and check the budget in how much it costs to build an app with AI in the UK.