snaptxt.app

AI Code Explainer

Paste code, get a plain-English explanation from on-device Gemini Nano. No upload, no API key — your snippet never leaves Chrome.

Code
Explanation · Gemini Nano on-device
Experimental

On-device AI isn't available in this browser

Open this page in Chrome 138 or newer with the Prompt API enabled (chrome://flags/#prompt-api-for-gemini-nano). All other snaptxt tools work in any browser.

Your code never leaves Chrome.

Explanations run on Gemini Nano — an on-device model bundled with Chrome. There’s no API key, no upload, no network call. Paste proprietary code without worrying about it ending up in training data.

How to use it

  1. 1Paste a function, query, or snippet into the editor on the left.
  2. 2Pick an explanation style: Concise (3-5 sentences), Line by line (a walk-through), or Code review (concrete observations + gotchas).
  3. 3Set the language hint if auto-detect picks the wrong one — useful for short snippets that look like multiple languages.
  4. 4Click Explain. Gemini Nano runs locally inside Chrome and streams the explanation into the right pane.

Common use cases

  • Make sense of unfamiliar code you've inherited from another team.
  • Walk through a tricky regex, SQL query, or shell one-liner you suspect of doing something subtle.
  • Get a second opinion on a function you wrote — the Code review style surfaces edge cases and naming issues.
  • Teach yourself a new language by pasting examples and reading the breakdown alongside the code.
  • Speed up code review by getting a summary before reading every line of a long PR diff.

Frequently asked questions

Where does the explanation come from?
On-device Gemini Nano — the small language model bundled with recent Chrome builds. It runs entirely on your CPU/GPU; no network call is made. Your code never leaves the browser.
What does "on-device" actually mean for privacy?
Literally: the model weights live on your disk after Chrome downloads them once, and inference runs locally. There's no API key to leak, no request log on a vendor server, no fine-print about training. Safe for proprietary code that an employer would not want sent to OpenAI / Anthropic / Google's cloud APIs.
Why does it say "Experimental"?
Nano is a small model — roughly 4 billion parameters compared to 1-2 trillion for frontier models. It's fast and private but it can be wrong about subtle behavior, especially in long or unusual code. Treat its output as a first-pass explanation, not as gospel.
What if the Explain button is disabled?
Your browser doesn't have the Prompt API enabled. Open this page in Chrome 138+ with chrome://flags/#prompt-api-for-gemini-nano set to Enabled, then restart Chrome. First use also downloads the ~2 GB model — that happens once and then everything is offline.
Is there a length limit on the snippet?
Around 6,000 characters — about 150 lines of average code. Nano's context window is short and quality degrades on long inputs. For longer files, paste the function or section you actually want explained.
Which languages does it understand?
Nano was trained on a wide mix and handles JavaScript, TypeScript, Python, Go, Rust, Java, C/C++, C#, Ruby, PHP, SQL, Bash, HTML, CSS, and more. The language hint is optional — auto-detect works for most short snippets — but helps when the code could be valid in multiple languages.
Will the explanation always be the same?
No. Language models sample, so the same code can produce slightly different wordings each run. The gist will be consistent; the exact phrasing won't.