L LLM Cloud Hub
Side-by-side comparison

Gemma 3n 4B vs Phi 4

Google

Gemma 3n 4B

{} JSON
Input / 1M
$0.0600
Output / 1M
$0.1200
View Gemma 3n 4B →
Microsoft

Phi 4

{} JSON
Input / 1M
$0.0700
Output / 1M
$0.1400
View Phi 4 →
Gemma 3n 4BPhi 4
Provider Google Microsoft
Context window Maximum tokens (input + output) the model can process in a single request. Glossary → 32,768 16,384
Capabilities Optional capabilities the model advertises: vision (images), tools (function calling), json_mode (structured output). json_mode json_mode
Input $ / 1M tokens Cost for tokens you send (prompt + context). Cheaper side highlighted. Glossary → 0.0600 0.0700
Output $ / 1M tokens Cost for tokens the model generates. Output is normally 3–5× pricier than input. Glossary → 0.1200 0.1400

Frequently asked questions

Which is cheaper, Gemma 3n 4B or Phi 4?

Gemma 3n 4B is cheaper than Phi 4 on a 50/50 input/output blend by about $0.015 per 1M tokens. Exact savings depend on your input-vs-output ratio — use the cost calculator on this page for a workload-specific estimate.

Which has a larger context window, Gemma 3n 4B or Phi 4?

Gemma 3n 4B has the larger context window at 33k tokens versus 16k tokens for Phi 4. That means Gemma 3n 4B can ingest about 2.0x as much text per request.

What is the difference between Gemma 3n 4B and Phi 4?

Gemma 3n 4B comes from Google; Phi 4 comes from Microsoft. They differ in pricing, context window, and supported capabilities — see the side-by-side table on this page for the exact figures, refreshed nightly.

Keyboard shortcuts

?
Show this overlay
/
Focus the first form field
g h
Go to / (home)
g b
Go to /best-llm-for
g c
Go to /cost
g s
Go to /self-hosted
g x
Go to /compliance
Esc
Close any overlay

Inspired by Linear and GitHub conventions. The two-key sequences (g then h) work within ~1 second.