Chat with Gemma 4 31B for free to solve coding problems, work through maths and read photos or screenshots. Google DeepMind built it as the largest dense Gemma 4 size, with strong competition maths results. No sign-up for first 3 messages.
Gemma 4 31B is Google DeepMind's largest dense Gemma 4 model. It was released by Google DeepMind on March 31, 2026, and is built for strong reasoning on a single consumer GPU or workstation. It has 30.7B parameters, 60 layers and a 256K-token context, so it can read long documents in one go. The model reads text and images through a vision encoder of about 550M parameters. This makes it useful for tasks that mix screenshots, charts and written questions. Its weights are open under the Apache 2.0 license, so anyone can download, run and adapt it.
Compared with Gemma 3 27B, this version brings frontier-level results to its size class. On Google DeepMind's model card it scores a Codeforces ELO of 2150 and solves 89.2% of AIME 2026 math problems without tools. This means serious coding and math power in an open model. It is the largest dense size of Gemma 4, and AIFreeForever's Gemma 4 page runs the faster 26B A4B size.
| Detail | Information |
|---|---|
| Made by | Google DeepMind |
| Model ID | google/gemma-4-31B-it |
| Released | March 31, 2026 |
| Status | The largest dense Gemma 4 model, open weights (Apache 2.0) |
| API price per 1M tokens | Free in / Free out |
| Price of Gemma 4 31B on AIFreeForever | Free |
| Detail | Information |
|---|---|
| Context window | 256K tokens |
| Inputs | Text, image |
| Output | Text |
| Thinks before it answers | A built-in thinking mode you can turn on or off |
| Detail | Information |
|---|---|
| MMLU Pro | 85.2%, Google DeepMind's model card |
| AIME 2026 (no tools) | 89.2%, Google DeepMind's model card |
| LiveCodeBench v6 | 80.0%, Google DeepMind's model card |
| GPQA Diamond | 84.3%, Google DeepMind's model card |
AIFreeForever is not affiliated with or endorsed by the model providers. All trademarks and logos belong to their owners.
Yes. Google offers Gemma 4 on the free tier of its Gemini API. This means you can run it with a Google AI Studio key at no cost. The model weights are also open under the Apache 2.0 license, which means anyone can download and run them.
However, you can access it for free on AIFreeForever. No sign-up for first 3 messages.
There are 5 ways to chat with Gemma 4 31B for free:
Scroll to the chat box at the top of AIFreeForever's Gemma 4 31B page, where the model is already selected for you.
Write or paste your question into the chat box, and keep it as short or as detailed as the task needs.
Attach a photo or a screenshot when it helps, so Gemma 4 31B can read what you see.
Send your message, then read the answer, compare it with another model or follow up. No sign-up for first 3 messages.
Gemma 4 31B answers in AIFreeForever's chat box at the top of the page. Chatting with Gemma 4 31B on AIFreeForever is easy, and the model is free to use. No sign-up for first 3 messages.
Gemma 4 31B scores 80.0% on LiveCodeBench v6, up from 29.1% for Gemma 3 27B, which means far more reliable code generation. Its general knowledge also improved, with MMLU Pro at 85.2% against 67.6%. The table below compares the two models on each benchmark.
This comparison was extracted from Google DeepMind and its evals methodology.
Gemma 4 31B leads every benchmark of the Gemma 4 family in Google DeepMind's table. It scores 89.2% on AIME 2026 maths, 84.3% on GPQA Diamond science and 80.0% on LiveCodeBench v6 coding. Its 66.4% on MRCR v2 long-context recall is far ahead of Gemma 4 26B A4B at 44.1%.
Gemma 4 26B A4B stays close on maths and coding, so it suits lighter, faster tasks. Pick Gemma 4 31B when you need the strongest reasoning, coding and long-document answers in the family. The table below shows the full scores.
This benchmark was extracted from Google DeepMind and its evals methodology.
Gemma 4 31B went through our six tests on December 3, 2026, run by AIFreeForever through an API with the same prompts for every model. It passed all 11 coding test cases and answered the math question correctly at $26.90. It also got 5 of 5 facts right and followed all 6 format rules in the instruction test. Its writing answer came in at 95 words. Across the five other tests it produced 3,706 output tokens in total, thinking included.
Speed numbers come from our runs on that day and depend on the provider that served each run. The median first answer word took 9.57 seconds at 100.3 tokens per second over 3 runs. Gemma 4 26B A4B was faster at 6.65 seconds, but it gave no answer in the instruction test, twice. So Gemma 4 31B is the steadier pick when a complete answer matters.
Tested by AIFreeForever on December 3, 2026 through an API, with the same prompts for every model. Coding, math, facts and the format rules were checked by code. Speed is the median of 3 runs and changes with the server that answered.
Write a JavaScript function isValidIsbn10(s) that returns true when the string s is a valid ISBN-10 and false otherwise. The string may contain hyphens, which are ignored. The last character may be X (meaning 10). Use the standard checksum: the sum of each digit times its weight 10 down to 1 must be divisible by 11. Reply with only the code in one code block.
Thinking at low effort, temperature 0.2. Took 16 s, 1,698 output tokens with thinking.function isValidIsbn10(s) {
const clean = s.replace(/-/g, '');
if (clean.length !== 10) return false;
let sum = 0;
for (let i = 0; i < 10; i++) {
const char = clean[i];
let value;
if (i === 9 && char.toUpperCase() === 'X') {
value = 10;
} else if (/\d/.test(char)) {
value = parseInt(char, 10);
} else {
return false;
}
sum += value * (10 - i);
}
return sum % 11 === 0;
}
Write a product description of about 100 words for a reusable steel water bottle made for hikers. It keeps drinks cold for 24 hours, weighs 340 grams and has a clip for a backpack. Use a friendly tone, no bullet points and no headings.
Thinking at low effort, temperature 0.2. Took 4.6 s, 435 output tokens with thinking.Stay hydrated on your next adventure with our lightweight steel water bottle, designed specifically for hikers who love the great outdoors. Weighing just 340 grams, it won't weigh you down as you conquer the trails. The best part? Your water stays ice-cold for a full 24 hours, providing a refreshing sip even on the hottest summer days. We've also included a handy clip, making it a breeze to attach to your backpack for easy access on the go. Durable, sustainable, and ready for the wild, this bottle is the perfect companion for every outdoor explorer.
A shop sells pens at 3 for $2.40 and notebooks at $3.75 each. Notebooks are 10% off today. Maria buys 12 pens and 4 notebooks and pays with a $50 note. How much change does she get? Show your working briefly, then give the final answer on the last line as "Answer: $X.XX".
Thinking at low effort, temperature 0.2. Took 4.5 s, 699 output tokens with thinking.Answer: $26.90
Answer each question with the answer only, one line each, numbered 1 to 5. 1. What is the chemical symbol for tungsten? 2. In what year did the Berlin Wall fall? 3. What is the capital city of Australia? 4. How many bones are in the adult human body? 5. Who wrote the novel "One Hundred Years of Solitude"?
Thinking at low effort, temperature 0.2. Took 3.5 s, 209 output tokens with thinking.Explain how photosynthesis works in about 250 words, for a high school student.
Asked 3 times. Thinking at low effort, temperature 0.2.Photosynthesis is the process by which plants, algae, and some bacteria convert light energy into chemical energy in the form of glucose (sugar). This process occurs primarily within the chloroplasts of plant cells, where a green pigment called chlorophyll absorbs sunlight.
The process is divided into two main stages:
1. The Light-Dependent Reactions
Taking place in the thylakoid membranes of the chloroplast, these reactions require direct sunlight. Chlorophyll absorbs solar energy, which is used to split water molecules ($H_2O$). This step releases oxygen ($O_2$) as a byproduct—the very oxygen we breathe. The energy captured from the sun is converted into two high-energy carrier molecules: ATP and NADPH.
2. The Light-Independent Reactions (The Calvin Cycle)
Occurring in the stroma (the fluid-filled space of the chloroplast), this stage does not require light. It uses the ATP and NADPH produced in the first stage, along with carbon dioxide ($CO_2$) absorbed from the air, to assemble a high-energy sugar molecule called glucose ($C_6H_{12}O_6$).
The Big Picture
The overall chemical equation is:
$6CO_2 + 6H_2O + light energy \rightarrow C_6H_{12}O_6 + 6O_2$
In short, plants take in water, carbon dioxide, and sunlight to create food for themselves and oxygen for the rest of the planet. This makes photosynthesis the foundation of almost every food chain on Earth.
List exactly 5 fruits. Rules: one fruit per line, each line starts with its number and a full stop ("1." to "5."), then one space and the fruit name in lowercase letters only. No fruit name may contain the letter "e". The fruits must be in alphabetical order. Write nothing else: no title, no notes.
Thinking at low effort, temperature 0.2. Took 11 s, 665 output tokens with thinking.Gemma 4 31B is free to use through Google's Gemini API. Input and output are both priced at $0 per 1M tokens on the free tier. That means you can build with this model and pay nothing while you stay within the free limits. You can also pay for an API key from an inference provider in order to access this model. However, on AIFreeForever, you can already test this model for free. The table below summarises the price of Gemma 4 31B.
Prices were checked on November 27, 2026 from Google's pricing and OpenRouter.
For developers in need of this model, OpenRouter lists Gemma 4 31B from many providers, from $0.10 per 1M input tokens. If you only want to try the model, AIFreeForever's chatbot lets anyone chat with it without an API key. No sign-up for first 3 messages.
Ask Gemma 4 31B a question, paste your code or add a file and get instant answers. Not satisfied? Compare your answers to other models for free.
Chat with Gemma 4 31BOn AIFreeForever, Gemma 4 31B is most often used for hard coding, maths and document work. Each item below shows what the model makes and a prompt to copy into the chat box.
Coding
Research
Report
Report
Interface
Tool Gemma 4 31B is good at hard maths, long documents and reading images, and it runs as a dense open model from Google DeepMind.
Work through maths problems, logic puzzles and step-by-step plans with a model built for careful thinking.
Paste whole reports, code bases or chat logs and ask questions across all of it in one go.
Upload screenshots, charts, forms or photos and get answers about what is in them.
Turn step-by-step reasoning on for hard questions and off for quick answers.
Build small agents that call your own tools and APIs through native function calling.
Use a model released under the Apache 2.0 license, so anyone can download and adapt it.
Gemma 4 31B by AIFreeForever is always free, works on your phone, answers in your own language and keeps your chats private.
Chat with Gemma 4 31B at no cost, with more messages each day after a one-time email code.
Use the same free chat on a phone, straight from Google Play.
Ask your question in your language and get the answer in it.
The @Resume skill writes a resume from your details, ready to download.
AIFreeForever only chooses model providers that promise zero data retention, and uploaded files are deleted once the answer is given.
Gemma 4 31B handles coding, maths and reading photos and screenshots, so you get clear answers on everyday work tasks.
Image input, a 256K-token context window and native function calling lead the features of Gemma 4 31B. It is Google DeepMind's open model for chat, documents and agents.
256K-token context: Feed in long reports, codebases or chat histories and the model keeps track of the whole thing.
Image input: Send photos, charts, screenshots or scanned pages at any aspect ratio and resolution, with OCR built in.
Thinking mode: Turn step-by-step reasoning on for hard maths and logic questions, or off for quick everyday answers.
Native function calling: Connect the model to your own tools and APIs when you build agents and automations.
Native system prompts: Set a fixed role, tone or rule set once and the model follows it across the conversation.
140+ languages: Pre-training covers over 140 languages. Around 35 or more are ready to use out of the box, so you can chat in your own language.
Gemma 4 31B is the dense Gemma 4 model. The table below sets it next to the 26B A4B size that AIFreeForever's Gemma 4 page runs. The comparison covers release date, context window and inputs. It also shows the price per 1M tokens on OpenRouter and the architecture, so you can see which size fits your chat needs.
Gemini rows were extracted from Google's pricing and the other rows from OpenRouter, checked on November 27, 2026.
Gemma 4 31B is the larger model in the family, while Gemma 4 26B A4B is built for speed. Gemma 4 31B scores a Codeforces ELO of 2150 against 1718, so it handles harder coding problems. It also reaches 66.4% on MRCR v2 at 128K against 44.1%, which means it keeps track of long documents better. The 26B A4B activates only 3.8B parameters, so it runs almost as fast as a 4B model. Pick Gemma 4 31B for tough reasoning and long files, and the 26B A4B for quick everyday chats.
On coding and science questions, Gemma 4 31B scores well ahead of Gemma 3 27B. It reaches 80.0% on LiveCodeBench v6 against 29.1%, and 84.3% on GPQA Diamond against 42.4%. That gap means far fewer wrong answers when you debug code or work through hard science problems. Gemma 4 31B also adds a thinking mode, native function calling and system prompts, which Gemma 3 27B lacks. Pick Gemma 4 31B for serious coding and study work.
Gemma 4 31B and Gemma 4 26B A4B differ mainly in how they use their parameters, and that changes recall and hard reasoning. Gemma 4 31B is a dense model, so all of its parameters work on every answer. Gemma 4 26B A4B is a Mixture-of-Experts model, so only a small part of it runs at a time. The official numbers on Hugging Face show what that means in practice.
Gemma 4 26B A4B leads on speed, since it runs almost as fast as a 4B model.
Gemma 4 31B works by a dense 60-layer design that mixes sliding-window attention of 1,024 tokens with full global attention. The last layer is always global, so the model keeps track of a whole document as it reads.
Every one of its parameters works on every token. That full use of the model is why Gemma 4 31B beats the smaller 26B A4B size on coding and long-context tests. A vision encoder of about 550M parameters reads images at their own aspect ratio and resolution, so screenshots and photos keep their detail. This design makes Gemma 4 31B a strong choice for coding help, long documents and image questions.
Gemma 4 31B is a strong open model, but a few limits are worth knowing before you pick it for a task.
Gemma 4 31B writes text and takes no audio input, so use it for writing, coding and questions rather than voice or sound tasks.
It runs slower than Gemma 4 26B A4B, which almost matches a 4B model for speed. So pick the 31B when quality matters more than wait time.
Its context window is 256K tokens, below the 1M of many 2026 models, so very long files may need splitting.
It scores 19.5% on HLE without tools, so the toughest expert questions remain difficult for it.
Like every language model, it can state wrong facts with confidence, so check important answers.
It writes text only, so pair it with an image model on AIFreeForever when you need pictures.
A good prompt for Gemma 4 31B gives the full task, the details it needs and the format you want back. This lets the model use its strong coding, maths and vision skills well.
Yes. You can chat with Gemma 4 31B for free on AIFreeForever. No sign-up for first 3 messages. After that, you may be asked to verify your email with a one-time code. Google also lists the model as free through its API, so developers can also test it at no cost.
Gemma 4 31B was made by Google DeepMind. It belongs to the Gemma 4 family of open models, which comes in several sizes.
Google DeepMind released Gemma 4 on March 31, 2026 in several sizes. Gemma 4 31B is the largest dense size in that family.
Google lists both input and output tokens as free for Gemma 4 31B through its API. On AIFreeForever the chat is free as well, so you can use the model without paying anything.
Gemma 4 31B handles a context of 256K tokens. That means you can paste long documents, code files or long chat histories and the model keeps track of all of it.
Yes, by a wide margin on the public benchmarks. Gemma 4 31B scores 85.2% on MMLU Pro against 67.6%, 84.3% on GPQA Diamond against 42.4%, and 80.0% on LiveCodeBench v6 against 29.1%. For study questions, science reasoning and coding, the newer model is a clear upgrade.
Gemma 4 31B accepts text and image inputs. You can share a photo, a diagram or a screenshot and ask about it in the same chat as your text.
Yes, Gemma 4 31B is usually available on AIFreeForever for free. At times of high demand the model can be at capacity, and an alternative model answers until it is back.
AIFreeForever only chooses model providers that promise zero data retention (ZDR). Chats are kept strictly private, to you only.
Yes. If you connect your email, you can choose to keep no history at all. History you choose to keep is deleted automatically after 7 days, and any uploaded file is deleted once the answer is given.
Ask Gemma 4 31B your next question on AIFreeForever. No sign-up for first 3 messages. Chat with Gemma 4 31B
Tell us if this AI content is offensive, harmful or wrong. We review every report and use it to improve our filters.
You made 10 pictures today.
Tell us how it went.
Your words go straight to our team.
We read every message.