Learn › Gemini Notebook Mastery › Code Engine: Write and Run Code on Your Data (Pro/Ultra Only)

Code Engine: Write and Run Code on Your Data (Pro/Ultra Only)

Beginner 🕐 12 min Lesson 10 of 13
What you'll learn
  • Explain what the Code Engine is and which Gemini Notebook tiers include it
  • Describe at least three practical tasks the Code Engine enables that standard chat cannot perform
  • Write a natural-language code prompt that analyzes data from an uploaded source

What Is the Code Engine?

The Code Engine is a secure, cloud-hosted Python environment that runs inside Gemini Notebook and has direct access to your uploaded sources. It was introduced on July 16, 2026 with the Gemini Notebook rebrand. Rather than asking the AI to interpret a spreadsheet in prose, you can write or prompt Python code that actually reads the file, runs calculations, and returns exact results.

This changes the notebook from a reading and synthesis tool into a lightweight data analysis environment — one where your uploaded files are the dataset and Gemini handles the code generation.

Tier Requirement

The Code Engine is a premium feature. At launch it is live on AI Ultra ($99.99/mo) and rolling out to AI Pro ($19.99/mo). It is not available on the free tier or on AI Plus. If you open the code editor panel and see a paywall prompt, that is your signal to upgrade or to work within the standard chat until access rolls out.

Accessing the Code Editor

When your plan includes the Code Engine, a code editor panel appears within the notebook interface. You can open it from the toolbar. Inside, you can write Python directly or type a natural-language description and let Gemini generate the code for you. The environment already has access to your uploaded sources — you reference them by name, and the engine handles the file parsing.

What You Can Do With the Code Engine

The comparison below shows what tasks unlock with Code Engine access versus what is possible through standard chat alone.

Task
Standard Chat
With Code Engine
Summarize a spreadsheet
Prose summary, may miss edge cases
Exact row/column analysis, pivot tables
Calculate statistics from a PDF table
Approximate, manually extracted
Parsed and computed precisely
Generate a chart from uploaded data
Not possible
Matplotlib/Plotly chart rendered in notebook
Extract structured data from a report
JSON approximation in prose
Real parsed output, downloadable
Compare values across multiple uploads
Qualitative comparison
Computed diff with exact numbers

Practical Examples

  • Analyze a CSV source: Upload a sales CSV, then prompt: "Calculate the average revenue per region and show me the top 5." The Code Engine reads the file, runs pandas, and returns exact figures.
  • Extract data from a PDF report: Upload an annual report PDF and prompt: "Pull all tables into a single structured summary."
  • Statistics from a Google Sheet: Add a Google Sheet as a source, then ask for a correlation analysis between two columns.
  • Visualize tabular data: Prompt the engine to generate a bar chart of quarterly growth from an uploaded spreadsheet.

Limits and Caveats

The Code Engine operates in a sandboxed environment. It can only access sources you have uploaded to that specific notebook — it cannot reach the internet, other notebooks, or your local files. The Python environment includes common data science libraries (pandas, matplotlib, numpy) but not every package. If a library is unavailable, the engine will tell you.

If You Don't Have Access Yet

If you are on the free tier or AI Plus, you can still ask analytical questions in standard chat. Gemini will do its best to interpret the data in prose and estimate values, but it will not run actual code. For anything requiring precision — financial calculations, statistical analysis, chart generation — the Code Engine is the right tool, and the upgrade to AI Pro or Ultra is the unlock.

Key takeaways
  • The Code Engine turns Gemini Notebook into a lightweight data analysis tool that operates directly on your uploaded files
  • It requires AI Pro or AI Ultra — free and AI Plus users cannot access it and should plan for an upgrade if data analysis is a core need
  • Even without the Code Engine, standard chat can answer approximate analytical questions — but for precision work, the Code Engine is the right tool
Learn more every week Get 5 hand-picked prompts + new AI tools every Monday. Free.