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
ExperimentalOn-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
- 1Paste a function, query, or snippet into the editor on the left.
- 2Pick an explanation style: Concise (3-5 sentences), Line by line (a walk-through), or Code review (concrete observations + gotchas).
- 3Set the language hint if auto-detect picks the wrong one — useful for short snippets that look like multiple languages.
- 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.
Related tools
Base64 Encode / Decode
Encode and decode text and files to and from Base64.
HTML Live Preview
Write HTML, CSS, and JavaScript and see the result instantly.
JSON Formatter
Format, validate, minify, diff, and explore JSON — with optional on-device AI that summarizes any payload in plain English.
JWT Decoder
Inspect the header, payload, and expiry of any JSON Web Token — with optional on-device AI that explains what the token grants in plain English.
SQL Formatter
Beautify, format, and minify SQL queries for any dialect — with optional on-device AI that explains what a query does in plain English.
Unix Timestamp Converter
Convert Unix timestamps to dates and back, in any timezone.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes in your browser.
JSON to TypeScript
Generate TypeScript interfaces or type aliases from JSON.
Markdown to PDF
Convert Markdown to a beautifully styled PDF in your browser.
QR Code Generator
Make QR codes for websites, Wi-Fi passwords, contact cards, social handles, email, SMS, and more. Download as PNG or SVG — or as a ZIP with one branded QR per social platform.
Password Generator
Generate strong, secure passwords in your browser. Nothing is sent or saved to any server.
Text Diff
Compare two pieces of text and see line-by-line, word-by-word, or character-by-character what changed.
UUID / ULID Generator
Generate UUID v4, UUID v7, or ULID identifiers in bulk, instantly in your browser.
SVG to PNG / JPEG / WebP
Convert SVG to PNG, JPEG, or WebP at any size — quality slider, transparent or colored background, copy to clipboard. Free, in your browser.
URL Encoder / Decoder
Encode or decode URLs and query parameters with component-vs-full-URI scope, plus a query-string breakdown. Free, in your browser.
Regex Tester
Test JavaScript regular expressions with live highlighting and a capture-group inspector — plus an AI regex generator that turns plain-English descriptions into regex (on-device Gemini Nano).
Color Converter
Convert colors between HEX, RGB, HSL, HSV, and OKLCH, and generate tint, shade, and harmony palettes. Free, in your browser.
HTML ↔ Markdown Converter
Convert HTML to Markdown or Markdown to HTML with a live preview. GFM tables, fenced code blocks, inline formatting. Free, in your browser.
Cron Builder
Build cron expressions visually or describe the schedule in plain English and let on-device AI write it for you. Plain-English explanation, next 5 runs, presets.
YAML ↔ JSON Converter
Bidirectional YAML / JSON conversion with multi-document support and indentation control. Free, in your browser.
Convert CSV to JSON
Bidirectional CSV / TSV / JSON conversion. Custom delimiters, header detection, auto-typed numbers. Free, in your browser.
Word & Character Counter
Live word, character, sentence, and paragraph counts with reading and speaking time. Free, in your browser.
Lorem Ipsum Generator
Generate placeholder text — paragraphs, sentences, words, or HTML-wrapped output. Free, in your browser.
JWT Generator
Sign JSON Web Tokens with HS256/384/512, RS256/384/512, or ES256/384. In-browser key generation, no server.
Image Compressor
Compress PNG, JPEG, and WebP images with a live quality slider and side-by-side preview. Free, in your browser.
Favicon Generator
Generate the full favicon set — ICO, PNGs at every size, apple-touch-icon, and PWA manifest — from one image. Free, in your browser.
CSS Gradient Generator
Build linear, radial, and conic CSS gradients visually with color stops, presets, and one-click copy. Free, in your browser.
Box Shadow Generator
Build CSS box-shadows visually with offset, blur, spread, opacity, and inset across stacked layers. Live preview, copy-ready CSS.
Mermaid Live Editor
Render Mermaid diagrams live — flowcharts, sequence, class, state, ER, gantt, pie, and mindmap. Export SVG or PNG.
X.509 Certificate Decoder
Paste a PEM-encoded X.509 certificate — inspect subject, issuer, validity, SANs, key usage, and SHA fingerprints. Free, in your browser.
Australian Medicare Number Generator
Generate and validate Australian Medicare card numbers instantly in your browser. Uses the official check-digit algorithm — perfect for testing and development.
Australian ABN Generator & Validator
Generate and validate Australian Business Numbers (ABN) using the official weighted checksum algorithm. Perfect for testing and development — runs entirely in your browser.
Australian ACN Generator & Validator
Generate and validate Australian Company Numbers (ACN) using the official check-digit algorithm. For testing and development — runs entirely in your browser.
Australian Tax File Number (TFN) Validator
Validate Australian Tax File Numbers (TFN) — checks format and the official check-digit algorithm. No TFN generation to protect against misuse. Runs entirely in your browser.
Australian BSB Number Validator
Validate Australian Bank State Branch (BSB) numbers — checks the 6-digit format and identifies the bank from the first two digits.
New Zealand IRD Number Generator
Generate and validate New Zealand IRD (Inland Revenue Department) numbers for testing and development. Uses the official check-digit algorithm.
New Zealand Business Number (NZBN) Generator
Generate and validate New Zealand Business Numbers (NZBN) — 13-digit GS1 identifiers used by NZ companies. For testing and development.
New Zealand Bank Account Number Validator
Validate New Zealand bank account numbers — checks the BB-BBBB-AAAAAAA-SS format, bank code, and overall structure.
Text Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, SCREAMING_SNAKE, Title Case and more — instantly in your browser.
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal — type in any field and the rest update live.
XML Formatter & Validator
Format, validate, and minify XML documents with custom indentation — uses the browser's native DOMParser, nothing uploaded.
CSS & JS Minifier
Minify CSS and JavaScript online — strip comments, collapse whitespace, and see byte-size savings. Runs entirely in your browser.