AI code generator: 12 prompts and what each tool costs

In brief

The best free AI code generator is the chatbot you already use. ChatGPT, Claude and Gemini all write code on a free plan, and GitHub Copilot Free adds 2,000 completions a month inside your editor. Paid plans start at $10 a month for Copilot Pro and $20 for ChatGPT Plus or Claude Pro, as of November 2026.

What prompt makes an AI code generator write working code?

Paste this into ChatGPT, Claude, Gemini or Whizi and fill the brackets: "Write [language and version] code that runs [where: command line, browser, spreadsheet macro]. Input: [describe it, with one real example]. Output: [what I want back, with one example]. Use only [allowed libraries]. Add a comment above each function. After the code, list three inputs that would break it."

A glowing green glass cube on a black plinth with thin lines of light running out of it into three small plinths holding a terracotta Claude starburst, a brushed silver OpenAI knot and a rainbow glass Gemini star, in a charcoal studio under white rim light.

It works because it fixes the four things a model can't guess: where the code runs, what goes in, what comes out, and what is off limits. The last line makes the model test its own work. Every prompt below follows the same shape, so you can swap the details and keep the skeleton.

Which AI code generator is free, and what does each paid plan cost?

ChatGPT, Claude, Gemini and GitHub Copilot all have a free plan that writes code, and the cheapest paid plan that's clearly for code is $10 a month. The chart shows the monthly price of five paid plans, taken from each vendor's own page on 15 November 2026.

Paid plans that write code cost $8 to $20 a month, and the free ones cost nothing
ChatGPT Gocheapest ChatGPT plan$8GitHub Copilot Prounlimited completions$10ChatGPT Plusexpanded Codex usage$20Claude Proincludes Claude Code$20Google AI Pro1M token window$19.99one square is $2 a month, paid monthly
ToolFree planPaid priceCode ownership or useBest at
ChatGPT$0, "Limited Codex access"Go $8, Plus $20, Pro from $100 a monthNot stated on the pricing pageQuick scripts and explanations
Claude$0, "Limited usage" every 5 hours and every week; runs code and creates ArtifactsPro $20 a month, $17 billed annuallyNot stated on the pricing pageLonger files and Claude Code on Pro
GeminiCanvas with no AI plan; 32K token windowAI Plus $4.99, AI Pro $19.99 a month (US page)Not stated on the limits pageLong chats on AI Pro, a 1M token window
GitHub Copilot$0, 2,000 completions a month, limited chat and agent usePro $10, Pro+ $39 a monthNot stated on the plans pageSuggestions inside your editor
Lovable5 build credits a day, up to 30 a monthPro price not stated on the page I read"You own your code", subject to third party rights in the AI modelsWhole apps and sites from a prompt
VondyFree to try, "no usage limits" on regeneratingNot statedNot statedOne box, 50+ languages
Whizi10 messages a day on Whizi AI, Auto and Claude Haiku, no cardPro $29.99 a month, first week $1.99Not statedClaude, GPT and Gemini in one app, with a JavaScript run sandbox and an HTML preview

Whizi loses in two places. Copilot completes lines inside your editor as you type, and Whizi is a chat. Lovable builds and hosts a whole app from one prompt, and Whizi hands you code to run yourself. Vondy needs no setup at all, though its page doesn't say whether you must sign up.

The sources are each tool's own page: OpenAI's pricing page, Claude pricing, Google's Gemini limits page and plans page, GitHub's Copilot plans, Lovable pricing and the Vondy generator. None of them prints a message count for its free chat, so you find the limit by hitting it. Prices change, so check the page before you pay.

What prompts generate scripts and automation?

A script prompt works when it names the files, the folder and the one action that must never happen. Fill the brackets and run the result on a copy first.

  1. Rename files: "Write a Python 3 script that renames every .jpg in a folder to [prefix]_001.jpg, [prefix]_002.jpg and so on, ordered by date taken. Print each old and new name before renaming. Never overwrite a file. Add a dry run flag that prints without renaming."
  1. Merge spreadsheets: "Write a Python script using pandas that reads every .csv in [folder], keeps the columns [column names], adds a column with the file name, and saves one merged.csv. If a column is missing in a file, fill it with blanks and print a warning."
  1. Scrape one page politely: "Write a Python script using requests and BeautifulSoup that reads [URL], pulls every [element, such as product name and price], and saves them to a CSV. Wait two seconds between requests. Stop if the page returns anything but 200. Check the site's terms first and tell me what to look for."
  1. Scheduled backup: "Write a PowerShell script that copies [source folder] to [destination folder] every night, keeps only the last seven copies, and writes one line to a log file for each run. Explain how to schedule it in Windows Task Scheduler."

What prompts generate web pages and small apps?

A web page prompt works when it asks for one file, names the look, and says what happens when someone clicks. One file means you can save it, double click it and see the result.

  1. Landing page: "Write one HTML file with inline CSS for a landing page for [what you sell]. Sections: headline, three benefits, a pricing row with [tiers], and a contact form that only shows a thank you message. Colors: [two colors]. It must look right on a phone. No outside libraries."
  1. Tool in the browser: "Write one HTML file with inline JavaScript that works as a [tip calculator, unit converter, countdown timer]. Show the inputs on top and the answer in large type under them. Validate the inputs and show a plain message if one is wrong."
  1. Small game: "Write one HTML file with a canvas game of [snake, memory cards, a simple platformer]. Use arrow keys, keep score on screen, and add a restart button. Comment the three constants I can change to make it easier or harder."

What prompts generate SQL, regex and tests?

Data and test prompts work when you paste the real shape of the data. A model that sees your column names writes the query. A model that guesses them writes a query that fails.

  1. SQL from a schema: "Here are my tables: [paste CREATE TABLE statements]. Write a [PostgreSQL, MySQL or SQLite] query that returns [the question in plain words], grouped by [column], newest first. Explain each join in one line. Don't change any data."
  1. Regex you can read: "Write a regular expression for [what to match, for example US phone numbers with or without dashes]. Give three strings it should match and three it should reject, then explain each part of the pattern in one short line."
  1. Unit tests: "Here is a function: [paste]. Write [pytest, Jest or JUnit] tests for it. Cover the normal case, an empty input, a very large input and one invalid input. Name each test after what it proves."

What prompts fix, explain and clean up existing code?

Paste the code you already have, because a model fixes what it can see. Two prompts cover most of the work.

  1. Debug an error: "This [language] code throws the error below. Code: [paste]. Error: [paste the full text]. Tell me the cause in one sentence, then give the smallest change that fixes it. Don't rewrite anything else."
  1. Explain and tidy: "Explain this code to someone who knows [basics] but not [the library or pattern]: [paste]. Then rewrite it with clearer names and no change in behavior, and show me a test that proves the behavior is the same."

For ranking the models on hard programming work, best AI for coding compares fifteen agent setups on an index of real tasks. For a bigger build, vibe coding tools lists apps that make the whole project from one prompt.

What mistakes ruin AI generated code?

Four mistakes cause most of the bad output, and each one has a cheap fix.

  1. A missing environment. The model writes for a language version you don't have. Fix: name the version and the place it runs in the first line.
  2. No example data. The code handles the data the model imagined. Fix: paste three real rows and the output you expect.
  3. Trusting a library name. Models sometimes call a function that doesn't exist in the version you installed. Fix: run it, and ask which version the code assumes.
  4. Asking for everything at once. A 300 line answer hides its bugs. Fix: ask for one function, test it, then ask for the next.

Stack Overflow's 2025 developer survey found more developers distrust the accuracy of AI tools (46%) than trust it (33%). It also found 66% named "AI solutions that are almost right, but not quite" as their biggest frustration, and 45.2% named debugging AI generated code as time consuming. Treat every answer as a draft you test.

Can one app replace a pile of code generators?

For most small jobs, yes: one chat with several models beats a bookmark folder of single purpose tools. Whizi, which publishes this page, puts Claude, GPT and Gemini in one app. Pro carries all three, and its first week is $1.99. The free plan gives 10 messages a day on Whizi AI, Auto and Claude Haiku, with no card.

Two things in Whizi's chat help with code. A short JavaScript block runs in a sealed sandbox right in the reply, with no network access and a 5 second cap, and the card shows the console output. An HTML page the model writes shows as a live preview you can switch to its source. That covers prompts 5, 6 and 7 above without leaving the chat.

The sandbox runs JavaScript only. Python, SQL and shell code come back as text for you to run yourself. If you want editor completions or a hosted app, Copilot and Lovable do that better. To compare two models on the same prompt, see AI for coding.

What can an AI code generator not do?

It can't promise the code is correct, secure or yours to claim in every case. Three limits matter before you ship anything.

First, correctness. A program can run and still be wrong, and the survey figures above say experienced developers feel the same. Test with data where you know the answer. For anything that handles money, passwords or personal data, have a person who knows the field review it.

Second, secrets. Never paste a password, an API key or a customer record into a prompt. Use fake values in the example and swap in the real ones on your own machine.

Third, ownership. The U.S. Copyright Office's January 2025 report says AI outputs "can be protected by copyright only where a human author has determined sufficient expressive elements." Code you write, edit and arrange yourself is on firmer ground than code you paste as is. Lovable says "You own your code," but adds that this is subject to third party rights in the underlying AI models. That isn't legal advice, and a contract needs a lawyer.

Workflow checklist
  • Name the language, version and where the code runs in the first line
  • Paste three real input rows and the output you expect
  • Run every answer on a copy of your data first
  • Ask for one function at a time, not the whole program
  • Never put a password or API key in a prompt
Common questions

Frequently asked questions

Is there a free AI code generator?

Yes. ChatGPT, Claude and Gemini each write code on a free plan, and GitHub Copilot Free allows 2,000 completions a month, as of November 2026. None of the chatbots prints a message count for free use. Claude Free runs code but doesn't include Claude Code, which is Pro and up.

Can ChatGPT generate code?

Yes. ChatGPT writes code in most languages, and OpenAI's pricing page lists "Limited Codex access" on Free and "Expanded Codex usage" on Plus at $20 a month. It gives no numeric limit. Best AI for coding compares it with Claude and Gemini on real tasks.

Which AI code generator is best for Python?

Any of the big three handles Python well, so pick by price and tooling, not language. Use the prompt in the first section and name the Python version. Run the result yourself, because Whizi's sandbox runs JavaScript only and most chat tools don't run Python for you.

Can I use AI generated code in a commercial project?

Usually yes, but check the tool's terms first. Lovable says you own your code, subject to third party rights in the AI models. The ChatGPT, Claude, Gemini and Copilot pricing pages I read don't state it. Test and review the code, because the legal risk is smaller than the bug risk.