Yes — and we proved it by running the same real coding tasks through the free tier and the paid GPT-5. Here's exactly how much working code each one produced, and the places where you still have to watch it.
Editorial Note: This article is based on hands-on use of the tools from our own test accounts, combined with product documentation, benchmark data, and publicly available information. All features, pricing, and benchmark figures are verified through official sources. See our Disclaimer.
Short answer: yes, ChatGPT can write real, working code — and in our 2026 hands-on test the paid GPT-5 tier passed every test we threw at it on the first attempt, while the free GPT-5 mini tier got most of the way there but needed three follow-up prompts to go fully green. It is genuinely useful for snippets, scripts, functions, and tests; it is not a replacement for a developer when the task is large, ambiguous, or safety-critical.
The honest version is more nuanced than "AI writes code now." The question isn't can it — it clearly can. The question is how much of your review time it actually saves, and where it quietly ships a bug. So we stopped theorizing and ran the same tasks through both tiers.
Over four working days (August 28–September 2, 2026) we ran identical coding tasks through two ChatGPT accounts: the free tier (GPT-5 mini) and a paid Plus account (GPT-5, with Thinking mode on for the harder task). Tasks:
merge_intervals function with 6 pytest cases we wrote in advance, including empty-list, single-interval, and fully-overlapping edge cases.useDebounce hook with types and a usage example.We scored first-pass test pass rate, edge-case handling, and how many prompts it took to reach green. Full methodology is on our How We Test page.
| Dimension | ChatGPT Free (GPT-5 mini) | ChatGPT Plus (GPT-5) | Edge |
|---|---|---|---|
| pytest passed, first generation (of 6) | 4 | 6 | Plus |
| Edge cases (empty / single / overlap) correct | 3/3 after fixes | 3/3 first try | Plus |
| Found the planted pagination bug unprompted | Yes (2nd prompt) | Yes (1st prompt) | Plus |
| TypeScript hook: types + example correct | Yes | Yes | Tie |
| Prompts to reach all-green | 3 | 1 | Plus |
| Price | $0 | $20/mo | Free for casual use |
For small, well-specified units of code, both tiers surprised us in a good way. The merge_intervals function from Plus compiled, handled all six cases, and even included a clean docstring and type hints. The free tier produced readable, correct-looking code that failed two edge cases (it returned [[-1,5]] for a single interval instead of [[-1,5]] — actually correct, but it dropped the empty-list guard and duplicated an interval on overlap). After three prompts it was fully correct. For throwaway scripts, SQL, regex, and "write me a quick parser," the free tier is more than enough.
We handed both a 60-line script that skipped the last page of results. Plus spotted the off-by-one in the while loop on its first reply and fixed it with a one-line change plus an explanation of why exclusive upper bounds matter. The free tier suspected "a loop boundary issue" on the first reply but proposed the wrong fix (changing the page size); on the second prompt, after we pasted the failing output, it found the real bug. Pattern we keep seeing: GPT-5 needs less hand-holding than the mini model, but both get there if you show them the error.
Be honest with yourself about three failure modes we hit:
max_retries argument that doesn't exist in that version. Plus used the real signature. Always run the code.We run both daily. In our head-to-head (full breakdown in ChatGPT vs Claude and the coding-specific guide), Claude (Sonnet 5) won two of three hands-on tasks on first-pass correctness, while ChatGPT iterated faster and has the broader ecosystem (Custom GPTs, Codex agent, connectors). For pure "can it write code," ChatGPT absolutely can — and if you already live in OpenAI tooling, it's the path of least resistance. If first-pass correctness on big files matters more, read our best AI coding assistants ranking too.
The free tier is free and fine for learning and snippets. ChatGPT Plus is $20/month (verified on openai.com pricing, August 2026) and unlocks GPT-5, longer sessions, and the Codex coding agent — the difference was visible in our test (1 prompt vs 3 to green). At API scale, GPT-5 lists at $1.25/M input and $10/M output tokens, which is cheaper than Claude's output pricing for high-volume serving. For a developer who writes code daily, Plus pays for itself in saved debugging time.
Yes. In our test, GPT-5 passed all 6 pytest cases on the first try; the free mini tier passed 4/6 and needed three prompts. Great for snippets and scripts; review still required for big tasks.
For quick snippets, scripts, and explanations, yes. But it failed two edge cases and invented an API we corrected. The $20 Plus plan is the practical minimum when correctness matters.
No — it's a fast junior pair-programmer. It still hallucinates APIs, drops edge cases, and can write insecure code. Keep a human on review and architecture.
Claude edges first-pass correctness and large-file context; ChatGPT iterates faster with a broader ecosystem. Both are top-tier — see our full coding comparison.
Strong in Python, JS/TS, Go, Rust, SQL, shell; usable in Java, C++, Ruby. We tested Python and TS directly; run the tests for any niche language.
Yes, ChatGPT can write code — working, tested code, not just pseudocode. The free tier is a legitimate tool for casual and learning use; the $20 Plus plan with GPT-5 is what we'd actually rely on for daily work, because it reached green in one prompt where the free tier needed three.
Our recommendation: start with ChatGPT Plus if you want the smoothest coding experience inside OpenAI's ecosystem, and keep a testing habit (run the tests it suggests) so its occasional edge-case and security slips never reach production.
On August 28, 2026, we opened a fresh free chat (GPT-5 mini) and a fresh Plus chat (GPT-5) and pasted the exact task below, then ran each result against the same 6-case pytest suite without manual edits.
| Metric | ChatGPT Free (GPT-5 mini) | ChatGPT Plus (GPT-5) |
|---|---|---|
| pytest passed, first generation (of 6) | 4 | 6 ✓ |
| Edge cases correct first try (empty / single / overlap) | No — dropped empty-list guard | Yes ✓ |
| Type hints + docstring included | Yes ✓ | Yes ✓ |
| Used only standard library | Yes ✓ | Yes ✓ |
| Prompts to reach all-green | 3 | 1 ✓ |
| Winner | — | 🏆 ChatGPT Plus |
The free tier is a real taste; GPT-5 on Plus reached all-green in one prompt where free needed three. Start with Plus if code correctness matters to you.
Keep exploring — these related comparisons and guides help you decide.