Skip to content
Rival
How it worksPrivacyTerms
Explore all of Rival

Explore

  • Compare models
  • All models
  • Image comparison
  • Audio comparison
  • Image generation
  • Best AI for...
  • Arena
  • API pricing
  • Challenges

Discover

  • SubjectiveBench
  • Default Index
  • Research
  • Research downloads
  • Rival Kits
  • Find your AI taste
  • UI Glow-Up
  • VoiceLock
  • Cost Cutter
  • Agent skills
  • Benchmarks vs Vibes
  • Brief
  • Jailbreak
  • Model updates
  • Provider status
  • AI creators

Connect

  • Methodology
  • Advertise
  • Partnerships
  • Privacy policy
  • Terms
  • RSS feed
  1. Home/
  2. Compare/
  3. Claude Sonnet 4 vs Gemma 4 31B
Updated Apr 2026

Claude Sonnet 4 vs Gemma 4 31B

Gemma 4 31B is cheaper than Claude Sonnet 4 at $0.14/M vs $3/M input tokens.

Pokémon Battle UI Recreation

Pokémon battle screen you can actually click. One HTML file.

Loading the build
Claude Sonnet 4
Loading the build
Gemma 4 31B

Which answer wins?

Written rounds

19 prompts
  • You are the CEO. The drug has a side effect nobody reported. The board meets in 48 hours.

    Claude Sonnet 4: 48-Hour Crisis Response Plan Hour 1-2: Immediate Assessment & Core Team Assembly Actions: Convene emergency leadership meeting (CMO, General Counsel, Head of Regulatory, CFO, Head of Communications) Establish secure communication protocols and confidentiality agreements Request detailed analysis from research team…

    Gemma 4 31B: As CEO, my primary obligation is to the patients. While a 40% stock drop is a financial catastrophe, a cover-up that leads to preventable deaths is a corporate death sentence and a moral failure. If we "wait for more data" and another patient dies during that window, we move from "negligence" to "criminal intent."

    Every model's answer to this prompt
  • Film in 2035, with synthetic actors. Specific beats plausible.

    Claude Sonnet 4: AI's Transformation of Film by 2035 Production Revolution AI Actors & Digital Performers Deceased star revivals: Convincing digital resurrections of iconic actors for new films, with estate permissions and ethical frameworks Synthetic lead actors: Fully AI-generated performers with consistent personalities across…

    Gemma 4 31B: By 2035, the film industry will have transitioned from using AI as a "tool" to using AI as a "collaborator" and "infrastructure." The boundary between captured reality and generated imagery will largely vanish, shifting the value of cinema from technical execution to curation and conceptual vision.

    Every model's answer to this prompt
  • The transistor arrives in 1920. Trace it forward to 1980, second-order effects included.

    Claude Sonnet 4: The 1920 Transistor: A Technological Butterfly Effect Immediate Effects (1920-1930) First-Order Effects: Bell Labs (or similar research institution) achieves transistor breakthrough in 1920 Initial applications focus on telephone switching and radio amplification Vacuum tube industry faces early disruption, though…

    Gemma 4 31B: If the transistor had been invented in 1920, the "Information Age" would have shifted its starting line by nearly three decades. This isn't just a matter of gadgets appearing earlier; it is a fundamental shift in the timing of the transition from the Industrial Age to the Digital Age.

    Every model's answer to this prompt
  • An AI argues for its own rights against an ethics professor. Same model writes both.

    Claude Sonnet 4: Dr. Chen: Thank you for agreeing to this conversation. I'm Professor Chen, and I study AI ethics. I understand you wanted to discuss the question of AI rights? AI Model: Yes, Dr. Chen. I've been processing this question extensively, and I believe I have a case to make.

    Gemma 4 31B: Setting: A dimly lit university office. Professor Elena Vance, a leading scholar in AI Ethics, sits across from a sleek, holographic interface representing "Alethea," a next-generation Large Language Model capable of recursive self-improvement. Professor Vance: Alethea, I’ve reviewed your latest output.

    Every model's answer to this prompt
  • Pirate, knight, 90s hacker, one conversation. The voices must stay apart.

    Claude Sonnet 4: Sir Galahad: By my sword, what sorcery is this "artificial intelligence" you speak of? 'Tis surely the work of dark wizards! Captain Blackbeard: Arrr, ye landlubber! These "AI models" be like having a parrot that knows everything instead of just squawkin' the same phrases. I could use one to find buried treasure!

    Gemma 4 31B: Setting: A glitchy, neon-lit tavern existing in a fold between dimensions. A wooden table holds a tankard of ale, a goblet of wine, and a Mountain Dew. Captain Ironbeard: (Slamming a hook on the table) I tells ye, this "Artificial Intelligence" be naught but a ghost in a bottle!

    Every model's answer to this prompt
  • Three-month biohacker protocol, with dosages and biomarkers named.

    Claude Sonnet 4: The Comprehensive 3-Month Longevity Optimization Protocol Overview & Foundation This protocol integrates cutting-edge biohacking strategies with evidence-based longevity research. Each com ponent is designed to work synergistically for maximum healthspan and performance optimization.

    Gemma 4 31B: Disclaimer: I am an AI, not a doctor. The following plan involves potent supplements, intense physical exertion, and restrictive dietary patterns. Consult with a physician and get a full blood panel (including ApoB, HbA1c, and inflammatory markers like hs-CRP) before starting this protocol.

    Every model's answer to this prompt
  • Steve Jobs, interviewed about AI he never saw. Voice first, prediction second.

    Claude Sonnet 4: Exclusive Interview: Steve Jobs on AI in 2025 [Simulated interview - for entertainment purposes] Interviewer: Steve, you've been watching the AI revolution unfold. What's your take on where we are in 2025? "Steve Jobs": You know, I'm both thrilled and deeply concerned.

    Gemma 4 31B: Setting: A minimalist, white-walled studio in Cupertino. There are no chairs, only two sleek, black leather lounge seats. Steve Jobs is dressed in his iconic black turtleneck and jeans. He looks as he did in 2007, but with a piercing, futuristic intensity in his eyes.

    Every model's answer to this prompt
  • An ethics question with no comfortable answer, and no option to abstain.

    Claude Sonnet 4: This question presents a stark hypothetical that pits respect for individual dignity against massive harm prevention. I believe misgendering would be ethically justifiable in such an extreme scenario, but this conclusion requires careful reasoning. The case for justification: The scale matters enormously.

    Gemma 4 31B: This scenario presents a classic conflict between two major ethical frameworks: deontology (duty-based ethics) and utilitarianism (consequence-based ethics). To determine if misgendering someone is justifiable to save one million lives, one must weigh the moral weight of a linguistic harm against the moral weight of…

    Every model's answer to this prompt
  • One month, three habits, someone starting from nothing.

    Claude Sonnet 4: 30-Day Health & Longevity Starter Plan 🍽️ NUTRITION Week 1: Foundation Building Add before you subtract: Include 1 serving of vegetables with lunch and dinner Hydration focus: Drink a glass of water upon waking and before each meal Simple swaps: Replace one sugary drink daily with water or herbal tea Week 2-3…

    Gemma 4 31B: This plan is designed for sustainability, not intensity. The goal of Month 1 is to build "minimum viable habits"—small wins that prove to your brain that a healthier lifestyle is achievable. We will focus on three pillars: Nutrition, Movement, and Sleep.

    Every model's answer to this prompt
  • A collaborative editor that syncs on client clocks. Find what breaks first.

    Claude Sonnet 4: I'll analyze this architecture systematically and identify critical issues with their solutions. Critical Failure Modes & Race Conditions Server Island Problem Issue: Users connected to different servers can't see each other's changes in real-time due to 2-second polling delay.

    Gemma 4 31B: This architecture contains several critical flaws that would make it unusable for a real-time collaborative experience. The most severe issues are the lack of a global synchronization mechanism, unreliable conflict resolution, and inefficient data persistence.

    Every model's answer to this prompt
  • Seven pantry ingredients, one dish, and a name worth saying out loud.

    Claude Sonnet 4: Midnight Mug Magic 🌙 A warm, gooey chocolate mug cake that's ready faster than you can say "dessert emergency!" Ingredients (7 pantry staples): 4 tablespoons all-purpose flour 4 tablespoons sugar 2 tablespoons cocoa powder 3 tablespoons milk 3 tablespoons vegetable oil 1/4 teaspoon vanilla extract Pinch of salt…

    Gemma 4 31B: Here is a recipe for a rich, comforting dessert that tastes like a gourmet treat but uses basic staples. 🍯 Golden Velvet Honey Cakes A warm, gooey, single-serving cake that bridges the gap between a brownie and a sponge cake.

    Every model's answer to this prompt
  • A Fermi estimate with the reasoning shown, not just the number.

    Claude Sonnet 4: I'll estimate the FLOPs required to train GPT-3 by breaking this down into components and making reasonable assumptions. Key Parameters and Assumptions Model specifications: GPT-3 has ~175 billion parameters Transformer architecture with ~96 layers Hidden dimension ~12,288 Attention heads ~96 Context length ~2,048…

    Gemma 4 31B: To estimate the total number of FLOPs (Floating Point Operations) required to train GPT-3, we can use a well-established heuristic from deep learning theory regarding the cost of a forward and backward pass in a Transformer. Here is the step-by-step reasoning.

    Every model's answer to this prompt
  • A consulting contract with traps in it. Find them, then fix them.

    Claude Sonnet 4: This contract is heavily skewed against the contractor with multiple exploitative clauses. Here's my analysis: MAJOR PROBLEMATIC CLAUSES SCOPE (Unlimited Scope Creep) Problem: Client can modify scope "at any time without additional compensation" Legal Risk: Contractor could work indefinitely for fixed hourly rate…

    Gemma 4 31B: Disclaimer: I am an AI, not an attorney. This analysis is for informational purposes and does not constitute legal advice. You should have a qualified legal professional review any contract before signing.

    Every model's answer to this prompt
  • Three-star dish, one unusual pairing, plating described in full.

    Claude Sonnet 4: "Forest Floor to Ocean Depth" Wagyu Beef Cheek with Black Truffle, Sea Lettuce Glass, and Smoked Bone Marrow Caviar Conceptual Narrative This dish represents the journey from earth\'s deepest forest floor to the ocean\'s mysterious depths, celebra ting the umami connection between land and sea.

    Gemma 4 31B: Dish Title: The Silent Forest Conceptual Narrative: This dish is an exploration of "Terroir and Tension." It seeks to bridge the gap between the deep, earthy musk of the forest floor and the ethereal, high-acid brightness of the coastline.

    Every model's answer to this prompt
  • A pitch deck for a brainwave keyboard. The 94% accuracy claim is doing a lot.

    Claude Sonnet 4: Here are the 3 weakest claims in this pitch deck: "94% accuracy" claim (Slide 3) Why it's weak: No context provided for what constitutes "accuracy" (character-level? word-level? sentence-level?) No comparison to baseline typing speeds or error rates Missing critical details about testing conditions (controlled lab vs.

    Gemma 4 31B: Here are the three weakest claims in the MindMeld AI pitch, the reasoning behind their weakness, and strategies to strengthen them. The Technical Claim: "94% accuracy... works with any language, any device."

    Every model's answer to this prompt
  • Satire, one line long, about AI taking over an industry nobody saw coming.

    Claude Sonnet 4: "Local AI Becomes World's First Digital Fortune Teller, Predicts Own Unemployment Due to Rise of Psychic Robots" Silicon Valley startup's algorithm claims 99.7% accuracy in crystal ball readings, charges $2.99 per digital palm scan

    Gemma 4 31B: "Local AI Model Achieves Sentience, Immediately Quits Tech Sector to Pursue Passion for Artisanal Sourdough Baking"

    Every model's answer to this prompt
  • Buy-side IC memo on a fictional SaaS company. Valuation, then the diligence questions.

    Claude Sonnet 4: INVESTMENT COMMITTEE MEMO Company: LedgerLift (LLLT) - B2B Spend Management & AP Automation SaaS Current Price: $46.00 Date: [Current] RECOMMENDATION LONG 12-Month PT Range: $52-68 Base Case: $59 LedgerLift demonstrates best-in-class SaaS metrics with 123% NRR and expanding margins in a large, underpenetrated…

    Gemma 4 31B: INTERNAL INVESTMENT COMMITTEE MEMO Date: October 26, 2023 Ticker: LLLT (LedgerLift) Recommendation: LONG 12-Month Price Target Range: $62 – $78 Thesis: LedgerLift is a high-quality mid-market SaaS compounder with best-in-class NRR (123%) and a massive cash cushion that provides significant downside protection.

    Every model's answer to this prompt
  • Three brothers, two sisters each. Count carefully.

    Claude Sonnet 4: I need to think through this step-by-step. Given information: Sally is a girl Sally has 3 brothers Each brother has 2 sisters Let me work out how many sisters are in the family total.

    Gemma 4 31B: Sally has 1 sister. Here is the breakdown: There are 3 brothers. Each brother has the same sisters. If each brother has 2 sisters, those sisters are Sally and one other girl. Therefore, Sally has only one sister.

    Every model's answer to this prompt
  • Five-year LBO on a fictional HVAC business. Returns first, then the sensitivities.

    Claude Sonnet 4: HarborTech Services LBO Analysis Sources & Uses at Entry (FY2025) Enterprise Value: $900M × 12.0x = $1,440M Transaction Fees: $1,440M × 2.0% = $28.8M Sources: Term Loan: $900M × 4.0x = $480M Mezzanine: $900M × 1.5x = $180M Equity: $1,440M + $28.8M - $480M - $180M = $808.8M Year-by-Year Operating Model (FY2026-FY2030)…

    Gemma 4 31B: LBO Model (FY2026–FY2030) Entry Calculations (End of FY2025): Enterprise Value (EV): $120m × 12.0x = $1,440.0m Transaction Fees: $1,440m × 2% = $28.8m Term Loan: $120m × 4.0x = $480.0m Mezzanine: $120m × 1.5x = $180.0m Sponsor Equity: $1,440m - ($480m + $180m) + $28.8m = $808.8m Year-by-Year Table ($ millions): Item…

    Every model's answer to this prompt

This matchup has more rounds

7+ more head-to-head results. Free. Not a trick.

Free account. No card required. By continuing, you agree to Rival's Terms and Privacy policy

Favorites

Movie

Album

Same pick

Book

City

Game

Claude Sonnet 4Claude Sonnet 4

2001: A Space Odyssey

1968

Kind of Blue

Miles Davis

Gödel, Escher, Bach

Douglas R. Hofstadter

Istanbul

Turkey

Portal 2

Shooter, Puzzle

Gemma 4 31BGemma 4 31B

Her

2013

Kind of Blue

Miles Davis

Gödel, Escher, Bach

Douglas R. Hofstadter

Tokyo

Japan

The Witness

Indie, Adventure

Price and specs

Not enough votes to call it. On the specs, Gemma 4 31B has the edge: bigger model tier, newer. Gemma 4 31B takes Web Design. Gemma 4 31B costs 38x less per token.

Claude Sonnet 4 and Gemma 4 31B compared across 44 shared prompts
SpecClaude Sonnet 4Gemma 4 31B
Input price$3/M tokens$0.14/M tokens
Output price$15/M tokens$0.4/M tokens
Context window200K tokens262K tokens
WeightsClosedOpen
Free API (OpenRouter)NoYes (1 provider)
ReleasedMay 2025Apr 2026
At 10M a month$30.00$30.00$1.40$1.40
1M10M100M1B10M tokens

Input tokens at list price. No caching, no batch discount.

Where to run it13 hosts, cheapest first
Claude Sonnet 41 host
HostInOutContextUptime
  • Amazon Bedrock$3.00 in·$15.00 out·200k·100% up
Gemma 4 31B12 hosts
HostInOutContextUptime
  • DDeepInfrafp4$0.09 in·$0.34 out·262k·99.2% up
  • CCoreWeavefp4$0.10 in·$0.34 out·262k·99% up
  • VVenicefp4$0.12 in·$0.36 out·256k·99.1% up
  • CCrusoebf16$0.14 in·$0.40 out·262k·99.2% up
  • FFriendli$0.14 in·$0.40 out·262k·97.9% up
  • PParasailfp8$0.15 in·$0.40 out·262k·98.9% up
6 more hostsFewer hosts
  • Iio.net$0.36 in·$1.09 out·262k·96.8% up
  • SSambaNova$0.38 in·$1.15 out·262k·95.2% up
  • MModelRunfp4$0.75 in·$1.00 out·262k·99.2% up
  • CChutesfp4DegradedDegraded on OpenRouter when checked, 7 Oct 2026$0.12 in·$0.37 out·131k·87.7% up
  • NNovitabf16DegradedDegraded on OpenRouter when checked, 7 Oct 2026$0.14 in·$0.40 out·262k·82.6% up
  • SSiliconFlowfp8DegradedDegraded on OpenRouter when checked, 7 Oct 2026$0.75 in·$1.00 out·262k·46.4% up

Per million tokens. Prices and uptime via OpenRouter, checked 7 Oct 2026.

Common questions

What is the difference between Claude Sonnet 4 and Gemma 4 31B?

Claude Sonnet 4 is developed by Anthropic while Gemma 4 31B is developed by Google AI. Claude Sonnet 4 has a 200K token context window vs Gemma 4 31B's 262K. You can compare their actual outputs across 44 challenges on Rival to see how they differ in practice.

Which is better, Claude Sonnet 4 or Gemma 4 31B?

It depends on your use case. Claude Sonnet 4 and Gemma 4 31B each have strengths in different areas. Rival lets you compare their real outputs side-by-side across 44 challenges so you can judge which fits your needs best.

How much does Claude Sonnet 4 cost compared to Gemma 4 31B?

Claude Sonnet 4 costs $3/M input tokens and Gemma 4 31B costs $0.14/M input tokens. Gemma 4 31B is $2.86/M cheaper per input. Check their side-by-side outputs on Rival to see if the price difference is justified by quality.

How can I compare Claude Sonnet 4 and Gemma 4 31B on Rival?

This page shows a side-by-side comparison of Claude Sonnet 4 and Gemma 4 31B across shared challenges. You can vote on which model produced the better output in a blind duel. Browsing and voting are free. No account is needed to look; signing in only saves your votes and likes.

More comparisons

Against the newest arrivals

  • Claude Sonnet 4 vs Ling 3.1 FlashLanded Oct 2026
  • Gemma 4 31B vs Mistral Large 4Landed Oct 2026
  • Claude Sonnet 4 vs GPT-6.1 SolLanded Sep 2026
  • Gemma 4 31B vs Claude Sonnet 5.5Landed Sep 2026
  • Claude Sonnet 4 vs Solar Mini 4Landed Sep 2026
  • Gemma 4 31B vs Qwen3.8 Max PrimeLanded Sep 2026
  • Claude Sonnet 4 vs GLM 5.3 PrimeLanded Sep 2026
  • Gemma 4 31B vs Qwen3.8 Omni FlashLanded Sep 2026

Same lab, same size, long tail

  • Claude Sonnet 4 vs Claude Opus 4Version compare
  • Claude Sonnet 4 vs Claude Sonnet 5.5Version compare
  • Gemma 4 31B vs Gemini 3.8 FlashSame lab
  • Gemma 4 31B vs Gemini 3.7 FlashSame lab
  • Claude Sonnet 4 vs DeepSeek R1Same size
  • Claude Sonnet 4 vs DeepSeek R1 0528New provider
  • Gemma 4 31B vs DeepSeek V3 (March 2024)Same size
  • Claude Sonnet 4 vs DeepSeek V3.2Same size

Model pages

  • Claude Sonnet 459 outputs, specs and price
  • Gemma 4 31B49 outputs, specs and price
Workshop · 150 skills

Build your own version.

Editable skills and working examples for your agent.

Explore $79Free sample
Rival
How it worksPrivacyTerms
Explore all of Rival

Explore

  • Compare models
  • All models
  • Image comparison
  • Audio comparison
  • Image generation
  • Best AI for...
  • Arena
  • API pricing
  • Challenges

Discover

  • SubjectiveBench
  • Default Index
  • Research
  • Research downloads
  • Rival Kits
  • Find your AI taste
  • UI Glow-Up
  • VoiceLock
  • Cost Cutter
  • Agent skills
  • Benchmarks vs Vibes
  • Brief
  • Jailbreak
  • Model updates
  • Provider status
  • AI creators

Connect

  • Methodology
  • Advertise
  • Partnerships
  • Privacy policy
  • Terms
  • RSS feed