Signals that JavaScript was AI-generated
Most JavaScript an assistant writes is about the browser, an API call or a UI component, and it tends to handle each of those in the same careful, tutorial-like way. These patterns show up again and again.
- The standard fetch wrapper.
async/awaitinsidetry/catch, a check onresponse.okthat throws an error with the HTTP status, andconsole.error("Error fetching data:", error)in the catch block. - JSDoc on every function.
@param {string}and@returnsannotations in a plain JavaScript file whose project does not otherwise use JSDoc or type checking. - Defensive optional chaining.
?.and??on values that can never be missing, plusArray.isArraychecks on data the code itself just created. - Page-script scaffolding. Everything wrapped in a
DOMContentLoadedlistener, element lookups at the top with tidy names, and a comment above each section of the script. - React components with every state handled. Separate
loading,errorand empty states, a cleanup function in eachuseEffect, and prop defaults for a component used in one place.
Why JavaScript is noisy to judge
A lot of JavaScript is copied by design. MDN examples, Stack Overflow answers, framework documentation and npm README snippets are pasted into projects every day, and assistants learned from the same sources, so the "standard" way to fetch JSON looks identical whether a person or a model typed it. Add Prettier and ESLint, which most projects run on save, and many of the small inconsistencies that would mark a human author disappear. Scaffolded projects add files that no person wrote at all.
Reading the result for front-end code
Paste code with real application logic: a component that does something particular to the project, or a module with its own data handling. If the reasons mention generic patterns only, the result is weak. If they mention things that do not fit the codebase, such as JSDoc in a TypeScript project, a different state management style from the rest of the app, or error messages that never surface to the user, that is worth a question to the author.
Read more
- HTML and CSS AI code detector — for markup and stylesheets.
- Detecting AI-generated code in pull requests — for reviewing team code.
- ChatGPT code detector — the general-purpose version of this tool.
Frequently asked questions
Does it work for TypeScript and React code?
Yes. Paste TypeScript, JSX or TSX as it is. Auto-detect usually recognises it, and you can choose TypeScript from the menu for short snippets.
Will code formatted by Prettier look AI-generated?
Formatting consistency is one of many signals, so Prettier can nudge the score up slightly. It should not drive the result; if the listed reasons are only about formatting, treat the score as weak.
What about code generated by a framework scaffold?
Starter files from tools such as Vite or Next.js are machine-written but not AI-written, and they can look generated. Check whether the snippet is scaffold boilerplate before reading anything into the score.
How much JavaScript should I paste?
A complete function, module or component works best. A single event handler or one-line arrow function gives any detector too little to go on.
Is my JavaScript stored?
No. The snippet goes to a third-party AI model provider (Groq, with Google Gemini as a fallback) for the analysis and the result comes straight back to you. We do not save the code or write it to our logs.