How to Vibe Code with ChatGPT: A Beginner's Step-by-Step Guide
You already know how to chat. That is the whole skill you need to start vibe coding with ChatGPT.
Vibe coding is the idea Andrej Karpathy described in February 2025: you describe the software you want in plain words, an AI writes the code, and you guide it with conversation. ChatGPT fits that idea in the simplest way: you open a chat, describe the app, and the code comes back in the same conversation.
That simplicity is also the catch. ChatGPT is a chat assistant, not a builder with a live preview and a publish button. It writes the code, but you have to take the code out of the chat, save it as a file, open it in your browser, and test it yourself. This guide walks through every step of it, in order, with a real example you can copy.
Table of contents
- What ChatGPT can and cannot do
- What you need before you start
- Step 1: Write your first prompt
- Step 2: Get the code out of the chat
- Step 3: Test it in your browser
- Step 4: Fix errors with follow-up prompts
- Step 5: Improve the design
- ChatGPT vs dedicated vibe coding builders
- Limits to know before you build
- Mistakes to avoid
- Frequently asked questions
- What to read next
What ChatGPT can and cannot do
ChatGPT is good at one thing here: turning a plain-words description into code. It can write the HTML for the structure, the CSS for the look and the JavaScript for the behaviour, and explain what each part does. What it cannot do is preview the app live, host it, or give it a database by itself.
Before your first prompt, know what you are asking for. It can write HTML for the structure of a page, CSS for how it looks, and JavaScript for how it behaves — a button that adds a task, a list that saves itself, a timer that counts down. It can explain its own code in plain words when you ask, and change the code when you describe the change you want.
What it cannot do matters just as much. ChatGPT does not deploy or host your app: when it finishes, the code sits in the chat window, with no link to share until you put it somewhere yourself. It does not run your app either, so it cannot see that a button does nothing — only you can, in your browser. And it cannot give your app a database by itself: a page it builds can save small amounts of data in your own browser, enough for a personal tracker, but it cannot store other people's data or keep accounts. If your idea needs that, use a platform such as Supabase, or a dedicated builder.
Finally, ChatGPT can write code that looks right but has a bug in it. That is why testing matters more than the first prompt: write, save, test, fix, repeat.
What you need before you start
You need a computer or laptop, a web browser, a ChatGPT account, and a way to save a text file. A phone works for chatting, but saving and testing a file is much easier on a laptop.
You also need a text editor: Notepad on Windows or TextEdit on a Mac will do, and a free editor such as Visual Studio Code makes code easier to read. Do not install anything else yet.
Decide what you are building before you open the chat. Pick something small and personal with one clear job — a study planner, a reading tracker, a to-do list, a habit tracker — and write it down in two or three sentences: what it is, who it is for, and what it must do. That note becomes your first prompt.
It helps to know the three pieces: HTML is the structure, CSS is the appearance, and JavaScript is the behaviour. Ask for a single-page app and ChatGPT will usually give you all three in one file.
Step 1: Write your first prompt
Your first prompt is the most important message in the project. A good one has four parts: what the app is, who it is for, what it looks like, and what it must do. Describe the result, not the code, and keep it to one page, one job and one audience — the 4-part formula.
That formula is explained in How to Write Vibe Coding Prompts That Work.
Here is a full example you can copy. It builds a study planner — a small app with a real job, small enough to get right on the first try.
Build a study planner web app called "My Study Plan". It is for me, a student who wants to plan study sessions for the week. It should have a form at the top where I type the subject, pick a day of the week, and enter how many minutes I plan to study, then an Add Session button. Below that it should show a list of all my sessions, grouped by day, with a delete button on each one, and a total number of study minutes for the week at the top. My sessions should still be there when I close the page and come back. Clean and simple design — white background, dark text, blue buttons, and it should look good on a phone as well as a laptop. Please give me the complete code in a single HTML file, with the CSS and JavaScript included in the same file.Why this prompt works: it names the app and its user, lists the features in the order they are met, says the data must be saved, describes the design, and ends by asking for a single file. Without that last line, ChatGPT may split the code into separate files that you have to piece together yourself.
A few habits make first prompts better. Keep it to one page and one job. Say what happens when the user does something, in order: type this, click that, then this appears. Name the colours and the layout instead of writing "make it look nice".
Step 2: Get the code out of the chat
ChatGPT will answer with some explanation and then a block of code. Your job is to get that code out of the chat and into a file: in a dedicated builder the code goes straight into a live preview, but in ChatGPT, you move it yourself.
Look for the copy button on the code block, usually at the top corner, and click it. Then open your text editor, paste the code into a new empty file, and save it with a name ending in .html — for example, study-planner.html. Save it somewhere you can find it, such as a new folder on your Desktop called my-apps.
Two mistakes are common here. First, do not copy the explanation text around the code — only the code itself goes in the file, or the page will break. Second, if ChatGPT gives you more than one code block, ask it to combine them into one complete HTML file, then copy that version instead.
Step 3: Test it in your browser
Now open the file: find study-planner.html and double-click it. It opens in your browser like any web page, except the address bar shows a file on your computer. That is fine — your app runs entirely in your browser for now.
When you want the file off your computer, put the code on GitHub and deploy it on Vercel or Netlify — the same hosts the dedicated builders use.
Test it like a real user. Type a subject, pick a day, enter minutes, and click Add Session. Does the session appear? Does the weekly total go up? Delete it — does it disappear? Close the page and open it again — are your sessions still there? Then make the browser window narrow and check nothing overlaps.
Write down everything that does not work, in plain words, before you go back to the chat. "The Add Session button does nothing" is useful; "it doesn't work" is not — ChatGPT cannot see your screen.
If the page opens blank, something usually went wrong when you copied the code — a missing piece at the start or the end of the block. Copy the block again carefully, from the first line to the last, paste it into a fresh file, and try again.
Step 4: Fix errors with follow-up prompts
Fixing is where the chat format is genuinely good. You stay in the same conversation and describe what went wrong. ChatGPT remembers the code it wrote, so it can change one part without rebuilding the whole app.
Paste the exact error message into the chat and describe what you see on the screen instead of guessing the cause — the exact error is the one line the AI can actually diagnose.
A good fix prompt has three things: what you clicked, what you expected, and what actually happened. Here is the shape to copy:
When I click the Add Session button, I expected the new session to appear in the list, but nothing happens at all. There is no error message. Please fix only this problem and do not change anything else in the app.If the browser shows an error message, paste the exact message into your prompt, word for word — you can see it by right-clicking the page, choosing Inspect, and opening the Console tab. The full set of fix prompts is in Vibe Coding Prompts Examples: Copy and Paste Prompts That Work.
One rule saves beginners hours: one fix at a time. Send one problem, get the corrected file, save it, test it, then send the next. Five problems in one message means three fixed, one broken and one forgotten — the full list is in Vibe Coding Mistakes Beginners Make. Replace the whole file with the corrected version instead of patching one line yourself.
Step 5: Improve the design
Once the app works, make it look like you meant it. Design prompts work best when they name exact changes — colours, sizes, spacing — instead of "make it look better":
Please make this study planner look cleaner. Change the background to white, the main text to dark grey, and make the headline bigger and bolder. Add more space between the sections, make all the buttons the same size and colour, and make sure the text is easy to read on a phone. Do not change any of the features or the wording.That last line protects the features while the design changes: without it, a design fix can quietly change a label or remove a button.
Improve in rounds, one idea per message: colours and spacing first, then buttons, then the phone layout. After each round, save and test before asking for the next change. If a change makes things worse, say so in plain words. You are the designer; ChatGPT types the code.
When the app works, looks clean, and is easy to read on a phone, it is done. Each extra change is another chance to break something that worked, so ship the simple version and use it for a week before asking for more.
ChatGPT vs dedicated vibe coding builders
ChatGPT is the simplest place to start, but for some jobs a dedicated builder is easier: a builder such as Lovable, Bolt.new or Replit Agent gives you a live preview, a file structure, and a way to publish, all in the same place. ChatGPT gives you the code and leaves the rest to you.
Lovable publishes to a lovable.app address, Bolt.new to its own hosted link, and Replit Agent builds, tests and publishes in one browser tab — the preview and the link are the builders' edge over chat.
| ChatGPT | Lovable / Bolt.new / Replit Agent | |
|---|---|---|
| Live preview | No — you save the file and open it yourself | Yes — the app runs in the builder as you build |
| Getting the code out | Copy the code block into a file yourself | Files are managed for you in the project |
| Publishing | You put the code on a host yourself | Publish step built into the builder |
| Best for | Small single-page apps, learning, quick experiments | Bigger apps, projects you want to share quickly |
| Learning the code | Easy to ask for a plain-words explanation | Possible, but the focus is on the finished app |
That table is a guide, not a verdict. For something small and personal, ChatGPT is a fine home. To share your app quickly, or to build several pages, a dedicated builder saves you the copy-and-save steps on every change. Many people use both: ChatGPT to draft the first version, then a builder to finish it. For the details, read How to Use Lovable for Beginners, Bolt.new Tutorial for Beginners, and How to Use Replit Agent for Beginners. The three-way comparison is in Replit vs Lovable vs Bolt.
Limits to know before you build
ChatGPT has honest limits. First, there is no live preview and no hosting: your app lives in a file on your computer until you put it somewhere public. Second, there is no database by itself. Third, every fix means copying code out of the chat and testing it yourself.
To share it, paste the code into a builder such as Lovable, Bolt.new or Replit, or host the file on a static host such as GitHub Pages or Netlify — treat publishing as a separate small project after your app works.
A single HTML file can save your own data in your own browser, enough for a personal planner or tracker, but it cannot keep a shared list, store accounts, or remember data across devices. If your idea needs other people to sign in or share data, use a builder with a database, or a platform such as Supabase.
Third, ChatGPT can write code that looks right but has bugs. Always test every feature yourself before you trust it.
Fourth, think about safety before anyone else uses your app. Do not put real user data — names, emails, passwords — into an app built this way without a safety check. Ask ChatGPT to check the app for security problems in plain words before you publish anything, and never hard-code an API key or a password into its code. The full picture is in Is Vibe Coding Safe? and Vibe Coding Security Risks for Beginners.
On price: ChatGPT has free and paid options, and what is included can change, so check the pricing page.
Mistakes to avoid
Most ChatGPT projects fail in the same few ways. The first is starting with a prompt that is too big: an app with five features in the first message comes back half-built. Start with one page and one job, then add the next feature in its own message.
Before you share anything ChatGPT built, run the safety check: ask it to look for the OWASP Top 10 basics — broken access control, injection and secrets left in code — and never paste a password or API key into the chat.
The second is copying only part of the code. Scroll to the very end of the block before you copy: a missing ending is the most common reason a page opens blank.
The third is testing nothing until the end. Test after each feature, and you will always know which change broke it.
The fourth is asking for five fixes in one message. One problem, one fix, one test — then the next. It feels slower, but it is faster.
The fifth is trusting the first answer. ChatGPT sounds sure of itself even when the code has a bug. Click every button, fill in every form, close the page and reopen it. The browser is the judge, not the chat.
The sixth is putting real data in an untested app. An app that asks other people for their names and emails needs the safety check first — if you are not sure it is safe, do not share the link yet.
Frequently asked questions
Can I vibe code with ChatGPT if I cannot code at all? Yes — that is the point. You describe the app in plain words, ChatGPT writes the code, and you test it in your browser. You do not need to write code yourself.
Is ChatGPT free for vibe coding? ChatGPT has free and paid options, and what is included can change over time, so check the pricing page for the current details.
Can ChatGPT publish my app on the internet? No. ChatGPT writes the code but does not host it. To share your app, paste the code into a builder such as Lovable, Bolt.new or Replit, or host the file on GitHub Pages or Netlify.
What kind of app should I build first? Something small with one job you will actually use: a study planner, a reading tracker, a to-do list or a habit tracker. The study planner in this guide is a good first project.
What do I do when the code does not work? Stay in the same chat and describe what you clicked, what you expected, and what actually happened — and paste the exact error message if the browser shows one. Fix one problem at a time, save the corrected file, and test it before moving on.
Is it safe to share an app I built with ChatGPT? Only after testing it and running a safety check: ask ChatGPT to check the app for security problems in plain words, and do not put real user data in it until you are sure it is safe. Is Vibe Coding Safe? and Vibe Coding Security Risks for Beginners explain what to check.
What to read next
- What Is Vibe Coding? — the idea in plain words.
- How to Vibe Code: Step-by-Step Guide for Beginners — the general workflow this guide applies to ChatGPT.
- Vibe Coding Prompts for Beginners — 15 starter prompts for your first projects.
- How to Write Vibe Coding Prompts That Work — the 4-part formula behind the first prompt in this guide.
- Vibe Coding Prompts Examples: Copy and Paste Prompts That Work — 14 copy-paste prompts, including fix-an-error and safety-check prompts.
- How to Use Lovable for Beginners: Build Your First App Step by Step — the builder to try when you want a live preview and a publish step.
- Replit vs Lovable vs Bolt — which builder fits your project, compared side by side.
Your first app is one chat away. Open ChatGPT, copy the study planner prompt, and send it.
Written by Samiullah Channa, Vibe Coding Guide. Published 6 December 2026.




Comments
Post a Comment