# How to Tell If Code is Written by Chatgpt

> To determine if code was written by ChatGPT, first check formatting and style, look for human-written inconsistencies or AI patterns, and Google the snippet. Next, test if the code works in real scenarios, and finally, use an AI code detector like GPTZero.

Canonical: https://livedemo.ai/tutorials/how-to-tell-if-code-is-written-by-chatgpt/
Updated: 2026-10-05
Interactive demo: https://story-api.livedemo.ai/workspaces/62255d3d3304f17b8f5e2d03/stories/692a4f84ab56e05a00ffbd5b/preview?step=1

## Steps

1. Check formatting & style.
2. Check for human-written code by looking for inconsistencies, personal comments, and less optimized but practical solutions.
3. Analyze the code structure for patterns, repetition, and overly optimized logic typical of AI-generated code.
4. Identify patterns in the code that are overly optimized, repetitive, or lack human-like variability.
5. Google the code snippet—if it matches Stack Overflow, it may be AI-generated.
6. Check if the code works in real scenarios.
7. Use an AI code detector like GPTZero ( https://gptzero.me/ )
