↻ SnippetShift Add to Chrome
v0.3 — now with quality modes, custom presets & provider compare

Translate any code.
Any language. Anywhere.

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

stackoverflow.com/questions/python-list-comprehension

How do I filter and transform a list in Python?

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

Python TypeScript Go Rust Java C# PHP Ruby Kotlin Swift React Vue SQL dialects Bash ↔ PowerShell

Built for the way you actually browse code.

No copy-paste, no juggling tabs, no dumping snippets into ChatGPT.

🎯

Detects every code block

Smart heuristic finds <pre>, <code>, GitHub .highlight, Medium, MDN, and any custom markup. Skips inline code & prose.

⚡

Auto language detection

80+ regex signals identify the source language with confidence scoring. Click the chip to override manually if you don't agree.

🔀

Diff view

Hit Ctrl+D to see exactly what changed line-by-line. No more squinting at two columns.

🔌

4 AI providers, your keys

OpenAI, OpenRouter, Groq, or Google Gemini. Switch providers or enter a newly released model ID at any time.

📜

History & cost tracking

The last 50 translations stay available in your popup. Per-provider token and cost estimates keep usage visible.

🛡️

Offline rules included

Common refactors (jQuery → Vanilla JS, ES Modules ↔ CommonJS, Promises → async/await) work without any API call. No key required.

🌑

Auto dark mode

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.

🧹

Smart sanitizer

Strips line numbers, shell prompts, and zero-width chars before sending so the AI doesn't waste tokens decoding the cruft you copied.

⌨️

Keyboard-first

Ctrl+↵ translate · Ctrl+D diff · Ctrl+L chain · Esc close.

Three steps. Twenty seconds.

1

Install & pick a provider

Add to Chrome, then enter your OpenAI, OpenRouter, Groq, or Gemini key. Provider pricing and free tiers are set by each provider.

2

Browse like normal

Hover any code block on Stack Overflow, MDN, GitHub, Medium, your team docs — a small ↻ Shift button appears.

3

Click & copy

Pick your target, hit Translate. Highlighted, diffable, and ready to paste into your editor.

Built for everyday polyglot work.

🎓

"This Python answer is great, but I'm writing TypeScript."

One click on the Stack Overflow code block — done.

🔄

"I'm porting this app from React class components to hooks."

Translate each component inline as you go.

🗄️

"Why is this MySQL query crashing on PostgreSQL?"

Translate it to PostgreSQL dialect and spot the diff.

🐚

"Tutorial uses Bash. I'm on Windows."

Bash → PowerShell, instantly.

🧪

"Stop copy-pasting into ChatGPT to get jQuery removed."

Built-in offline rule. Free, instant, no AI call.

📝

"Documenting code in two languages."

Translate, diff, copy — done.

Free during launch. Pro-ready by design.

The launch build gives every user Founder access. Provider API charges, if any, are paid directly to the provider.

Launch
Founder access
$0
All local Pro features are unlocked during the launch period.
Recommended
After launch
Pro Lifetime
One time
Quality modes, custom presets, provider compare, and unlimited BYOK requests.
Provider billing
Bring your own key
Direct
SnippetShift adds no API markup. Check current pricing with your chosen provider.

Usage estimates are shown locally. Unknown custom-model pricing is labeled unavailable instead of being presented as free.

FAQ

Is my code sent to a server you control? ▾

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.

How accurate are the translations? ▾

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.

Do I have to pay anything to start? ▾

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.

Will my API key leak? ▾

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.

Which sites does it work on? ▾

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.

Open source? ▾

Yes — MIT license. The source repository URL will be published with the Chrome Web Store release.

Stop pasting code into ChatGPT.

Install SnippetShift and translate any snippet, anywhere on the web, in one click.

Ask about availability

Chrome 120+ · v0.3.3 · MV3 · No telemetry