Google: Gemma 3 27B vs Microsoft: Phi 4

Neither wins outright: Google: Gemma 3 27B is the pick when you need to fit long inputs in one request, Microsoft: Phi 4 when cost matters at scale.

Key numbers

SpecGoogle: Gemma 3 27BMicrosoft: Phi 4
ProviderGoogleMicrosoft
Input price (per 1M tokens)$0.08$0.07
Output price (per 1M tokens)$0.35$0.14
Blended price (3:1 input/output)$0.15$0.09
Cheaper than … of all models we track75%82%
Context window131K tokens (~197 pages)16K tokens (~25 pages)
Larger context than … of all models22%4%
Max output per response118K tokens (~88,500 words)15K tokens (~11,100 words)
Input typestext, imagetext
Output typestexttext
Free variantYesNo
Listed since2025-03-122025-01-10
Advertisement

What it costs for real workloads

Monthly cost at list price for five common workloads. Token counts per unit are stated so you can scale them to your own traffic. A workload that does not fit a model's context window is marked rather than priced.

Workload (per month)Google: Gemma 3 27BMicrosoft: Phi 4Difference
Customer-support chatbot
50,000 conversations — each a 6-turn conversation (1,500 in / 400 out tokens)
$13.00$8.05Microsoft: Phi 4 saves $4.95
RAG search over documents
20,000 questions — each a question answered from ~8 retrieved passages (6,000 in / 500 out tokens)
$13.10$9.80Microsoft: Phi 4 saves $3.30
Coding / tool-using agent
2,000 tasks — each a multi-step task with tool calls and file context (60,000 in / 6,000 out tokens)
$13.80Doesn't fit context—
Batch summarisation
10,000 documents — each a 6,000-word report summarised to a page (8,000 in / 600 out tokens)
$8.50$6.44Microsoft: Phi 4 saves $2.06
Long-document analysis
500 documents — each a 150-page contract or codebase read in one pass (100,000 in / 2,000 out tokens)
$4.35Doesn't fit context—

Capabilities side by side

CapabilityGoogle: Gemma 3 27BMicrosoft: Phi 4What it lets you do
Tool / function calling✓ Yes—call your APIs and run agent loops
Structured output (JSON schema)✓ Yes✓ Yesreturn JSON that validates against your schema
Reasoning / thinking mode——spend extra tokens thinking before answering hard problems
Image input✓ Yes—read screenshots, charts and scanned pages
Audio input——take speech or audio directly
File / PDF input——accept documents without your own parsing step
Image output——generate images, not just text
Built-in web search——answer from live web results
Seed (reproducible sampling)✓ Yes✓ Yesrepeat a generation for tests and evals
Log-probabilities✓ Yes—read token confidence for classification and scoring

From each model's published parameters and input/output types. “—” means not advertised, not proven absent.

Price history

DateModelInput / 1MOutput / 1M
2026-10-18Google: Gemma 3 27B$0.08$0.35
2026-08-06Google: Gemma 3 27B$0.08$0.45
2026-08-06Microsoft: Phi 4$0.07$0.14
2026-03-31Google: Gemma 3 27B$0.08$0.16
2026-03-31Microsoft: Phi 4$0.07$0.14

Which should you choose?

Choose Google: Gemma 3 27B if…

  • you need to fit long inputs in one request — 131K tokens is roughly 197 pages, against 25
  • you need tool / function calling — to call your APIs and run agent loops; Microsoft: Phi 4 does not advertise it
  • you need image input — to read screenshots, charts and scanned pages; Microsoft: Phi 4 does not advertise it
  • you need log-probabilities — to read token confidence for classification and scoring; Microsoft: Phi 4 does not advertise it
  • you generate long outputs in one go — up to 118K tokens (about 88,500 words) per response
  • you want to prototype at zero cost — a free variant is listed

Choose Microsoft: Phi 4 if…

  • cost matters at scale — it is 41% cheaper on a typical 3:1 input/output mix ($8.05 vs $13.00 a month for 50,000 support chats)

Frequently asked questions

Is Google: Gemma 3 27B better than Microsoft: Phi 4?

Neither wins outright: Google: Gemma 3 27B is the pick when you need to fit long inputs in one request, Microsoft: Phi 4 when cost matters at scale. In short: Google: Gemma 3 27B when you need to fit long inputs in one request, you need tool / function calling, you need image input, you need log-probabilities, you generate long outputs in one go, you want to prototype at zero cost; Microsoft: Phi 4 when cost matters at scale.

Which is cheaper, Google: Gemma 3 27B or Microsoft: Phi 4?

Microsoft: Phi 4 is cheaper: $0.09 vs $0.15 per 1M tokens at a typical 3:1 input/output mix, 41% less. For 50,000 support conversations a month that is $8.05 against $13.00.

How much do Google: Gemma 3 27B and Microsoft: Phi 4 cost per million tokens?

Google: Gemma 3 27B costs $0.08 per 1M input tokens and $0.35 per 1M output tokens; Microsoft: Phi 4 costs $0.07 input and $0.14 output. Output tokens are billed separately, so long answers shift the gap.

Which has the bigger context window, Google: Gemma 3 27B or Microsoft: Phi 4?

Google: Gemma 3 27B: 131K tokens, about 197 pages, against 16K (about 25 pages) for Microsoft: Phi 4.

Do Google: Gemma 3 27B and Microsoft: Phi 4 support function calling and JSON output?

Tool calling — Google: Gemma 3 27B: yes, Microsoft: Phi 4: not advertised. JSON-schema structured output — Google: Gemma 3 27B: yes, Microsoft: Phi 4: yes.

Can Google: Gemma 3 27B or Microsoft: Phi 4 read images?

Only Google: Gemma 3 27B accepts image input; Microsoft: Phi 4 is text-only for input.

Is Google: Gemma 3 27B or Microsoft: Phi 4 free to use?

Google: Gemma 3 27B has a free variant (google/gemma-3-27b-it:free). Free variants usually carry tighter rate limits.

What is the maximum output length of Google: Gemma 3 27B and Microsoft: Phi 4?

Google: Gemma 3 27B can write up to 118K tokens (about 88,500 words) per response; Microsoft: Phi 4 up to 15K (about 11,100 words).

When were Google: Gemma 3 27B and Microsoft: Phi 4 released?

Google: Gemma 3 27B was listed on 2025-03-12; Microsoft: Phi 4 on 2025-01-10.

Has the price of Google: Gemma 3 27B or Microsoft: Phi 4 changed?

Google: Gemma 3 27B: output price cut 22% ($0.45 → $0.35/1M) on 2026-10-18 (3 price changes since 2026-03-10). Microsoft: Phi 4: input price raised 7% ($0.07 → $0.07/1M) on 2026-08-06 (2 price changes since 2026-03-10).

About the two models

Google

Google: Gemma 3 27B

Gemma 3 introduces multimodality, supporting vision-language input and text outputs. It handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities,...

Full Google: Gemma 3 27B specs →
Microsoft

Microsoft: Phi 4

[Microsoft Research](/microsoft) Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed. At 14 billion...

Full Microsoft: Phi 4 specs →

Compare Google: Gemma 3 27B with other models

Compare Microsoft: Phi 4 with other models

Advertisement