A Chrome extension that puts a ↻ Shift button on every code block on the web. One click translates it between 16 languages or frameworks — using your API key, on your machine.
Open source · MIT licensed · OpenAI, OpenRouter, Gemini & Groq · No SnippetShift server or telemetry
Asked 8 years ago · 142 votes · ✓ Top answer
You can use a list comprehension with a conditional clause:
# Get squared values of even numbers numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] squared_evens = [n ** 2 for n in numbers if n % 2 == 0] print(squared_evens)
Click the button → pick TypeScript →
// Get squared values of even numbers const numbers: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const squaredEvens: number[] = numbers .filter(n => n % 2 === 0) .map(n => n ** 2); console.log(squaredEvens);214 tok · $0.0001
Translates between
No copy-paste, no juggling tabs, no dumping snippets into ChatGPT.
Smart heuristic finds <pre>, <code>, GitHub .highlight, Medium, MDN, and any custom markup. Skips inline code & prose.
80+ regex signals identify the source language with confidence scoring. Click the chip to override manually if you don't agree.
Hit Ctrl+D to see exactly what changed line-by-line. No more squinting at two columns.
OpenAI, OpenRouter, Groq, or Google Gemini. Switch providers or enter a newly released model ID at any time.
The last 50 translations stay available in your popup. Per-provider token and cost estimates keep usage visible.
Common refactors (jQuery → Vanilla JS, ES Modules ↔ CommonJS, Promises → async/await) work without any API call. No key required.
Panel UI follows your OS theme. Both source & output are syntax-highlighted in light or dark. Shadow DOM means host-page CSS can never break it.
Strips line numbers, shell prompts, and zero-width chars before sending so the AI doesn't waste tokens decoding the cruft you copied.
Ctrl+↵ translate · Ctrl+D diff · Ctrl+L chain · Esc close.
Add to Chrome, then enter your OpenAI, OpenRouter, Groq, or Gemini key. Provider pricing and free tiers are set by each provider.
Hover any code block on Stack Overflow, MDN, GitHub, Medium, your team docs — a small ↻ Shift button appears.
Pick your target, hit Translate. Highlighted, diffable, and ready to paste into your editor.
One click on the Stack Overflow code block — done.
Translate each component inline as you go.
Translate it to PostgreSQL dialect and spot the diff.
Bash → PowerShell, instantly.
Built-in offline rule. Free, instant, no AI call.
Translate, diff, copy — done.
The launch build gives every user Founder access. Provider API charges, if any, are paid directly to the provider.
Usage estimates are shown locally. Unknown custom-model pricing is labeled unavailable instead of being presented as free.
No. Code goes directly to your selected provider, or up to three configured providers when you choose Compare. Connection tests send a ping and API key. SnippetShift has no backend, analytics, or request logging.
Accuracy depends on the provider, model, source, and target. Review and test generated code before use. Offline conversions cover limited syntax-checked patterns; complex transformations require AI. The panel includes a diff view to support review.
The launch build has no extension fee. Provider API pricing is separate and may change. Built-in offline rules and cached results require no provider request.
Starting with v0.3.2, saved keys are encrypted with AES-256-GCM using a non-exportable key stored by the extension. They never appear in page DOM and are sent only as authentication data to the provider you chose. Encryption cannot protect a compromised browser profile or device. Keys are never sent to SnippetShift because SnippetShift has no server.
Ordinary web pages with recognizable <pre> code blocks are supported. You can also select code or use the popup. Browser internal pages, the Chrome Web Store, inaccessible frames, and some custom editors restrict injection. Site layouts can change; compatibility is not guaranteed for every website.
Yes — MIT license. The source repository URL will be published with the Chrome Web Store release.
Install SnippetShift and translate any snippet, anywhere on the web, in one click.
Ask about availabilityChrome 120+ · v0.3.3 · MV3 · No telemetry