Code Interpreter (Advanced Data Analysis)
Last reviewed
Jun 1, 2026
Sources
15 citations
Review status
Source-backed
Revision
v1 ยท 2,650 words
Improve this article
Add missing citations, update stale details, or suggest a clearer explanation.
Last reviewed
Jun 1, 2026
Sources
15 citations
Review status
Source-backed
Revision
v1 ยท 2,650 words
Add missing citations, update stale details, or suggest a clearer explanation.
Code Interpreter, later renamed Advanced Data Analysis, is a feature of ChatGPT developed by OpenAI that lets the model write and run Python code inside a sandboxed execution environment. The model can use the environment to analyze files that a user uploads, perform calculations, generate charts and other images, and produce files for download. Rather than only describing how a task might be done, ChatGPT can carry it out: it writes code, runs it, reads the output or any error messages, and revises the code until it reaches a result. [1][2]
OpenAI first made the feature available in March 2023 as one of two plugins it hosted itself, alongside a web-browsing plugin, when it opened ChatGPT to third-party plugins. [1] It moved out of limited testing in July 2023 with a rollout to all subscribers of the paid ChatGPT Plus tier. [3][4] In late August 2023, around the launch of ChatGPT Enterprise, OpenAI renamed the feature Advanced Data Analysis, keeping the same functionality. [5][6] The capability was later folded into the default tool set of newer models such as GPT-4o, so users no longer needed to select a separate mode to trigger it. [7][8]
Code Interpreter is often cited as an early and widely used example of large language model tool use, sometimes described as an agentic capability, because the model invokes an external tool, observes the result, and iterates toward a goal with little human intervention. [9] A closely related tool of the same name is offered through the OpenAI Assistants API, which gives developers programmatic access to the same kind of sandboxed Python execution. [10]
| Field | Detail |
|---|---|
| Developer | OpenAI |
| Type | Sandboxed code execution and data analysis tool for ChatGPT |
| Launched | March 2023 (limited plugin alpha); July 2023 (broad rollout to ChatGPT Plus) |
| Renamed | Advanced Data Analysis (late August 2023); later merged into the default tool set of GPT-4o and later models |
| Availability | ChatGPT Free (limited), Plus, Pro, Team, and Enterprise tiers |
| Runtime | Network-isolated sandbox running a Python interpreter with preinstalled scientific libraries |
| Related products | OpenAI Assistants API code interpreter tool; ChatGPT plugins; ChatGPT data analysis |
The feature has carried several names. OpenAI introduced it as the "Code Interpreter" plugin in March 2023. [1] When the company rebranded it in late August 2023, it became "Advanced Data Analysis." [5][6] Press coverage at the time noted that the rename was largely a marketing decision: the original name suggested the tool was only for programmers, whereas the new name signaled that analysts, researchers, and other non-developers could use it to work with data. [6] As OpenAI integrated the capability into general-purpose models, the company's documentation increasingly referred to it simply as "data analysis" within ChatGPT, and the model decides on its own when to run code rather than requiring the user to switch into a dedicated mode. [7][8] Despite the changing names, the underlying mechanism is the same: ChatGPT generates Python and executes it in a controlled sandbox. [2][8]
OpenAI announced ChatGPT plugins on March 23, 2023. [1] As part of that launch the company said it would host two plugins itself, a web browser and a code interpreter. [1] Access was initially limited. OpenAI rolled out plugin access in alpha to a small number of developers and ChatGPT Plus subscribers drawn from a waitlist, with plans to expand over time. [1]
The broad release came a few months later. On July 6, 2023, OpenAI began rolling out Code Interpreter to all ChatGPT Plus users, a process the company said would take about a week. [3][4] At that stage the feature was still labeled a beta and had to be turned on through a toggle in the ChatGPT settings under beta features. [3] OpenAI described it as letting users "run code, optionally with access to files you've uploaded," and gave examples such as analyzing data, creating charts, editing files, and performing math. [3]
On August 28, 2023, OpenAI launched ChatGPT Enterprise, a business edition of the product. [11] Enterprise customers received unlimited access to the feature, which by then OpenAI was referring to as Advanced Data Analysis, the capability "formerly known as Code Interpreter." [5][11] The rename appeared in the product's release notes around the same time. [6]
The feature continued to evolve the following year. In May 2024, alongside the release of GPT-4o, OpenAI announced improvements to data analysis in ChatGPT, including interactive tables and charts and the ability to add files directly from Google Drive and Microsoft OneDrive instead of uploading them from a local disk. [7] Later that month OpenAI also extended data analysis, file uploads, vision, browsing, and access to GPTs to all ChatGPT Free users, subject to tighter usage limits than on paid tiers. [12] With these changes the separate "Advanced Data Analysis" mode largely disappeared from the interface, and code execution became part of what GPT-4o and later models could do automatically within a normal conversation. [7][8]
When ChatGPT decides that a task is best handled with code, it writes a Python program and submits it to a sandboxed runtime that runs separately from the language model. [2][8] The runtime executes the code, captures its output, and returns the results to the model, which can then explain them in natural language, display a generated chart, or offer a file for download. [2][7] If the code raises an error, the model can read the traceback and try a corrected version, often repeating this loop several times without the user intervening. [9]
The sandbox is an ephemeral, network-isolated environment. It has no access to the internet: domain name resolution fails and outbound connections are blocked, so the code cannot fetch remote data or call external services. [2][13] Independent investigations of the environment have reported that it runs on an x86_64 Linux system with a small amount of memory, on the order of a single gigabyte of RAM, and that uploaded files are placed in a working directory at /mnt/data. [13][14] The specific Linux distribution and library versions have changed over time as OpenAI updated the image; early reports described an Ubuntu-based system, while later inspections found a Debian-based one. [14][13]
The environment comes with a Python interpreter and a set of preinstalled libraries commonly used for data work, including pandas for tabular data, NumPy for numerical computing, and matplotlib for plotting. [2][7] Because the sandbox has no internet access, the model normally cannot install additional packages from a package index, and it is limited to the libraries already present in the image. [13] Users upload files through the chat interface, and the model can read them, transform them, and write new files back into the working directory for the user to download. [2][7]
State inside the sandbox is tied to a session and does not persist indefinitely. The runtime keeps variables, intermediate results, and uploaded files available for the duration of an active session, but the environment is torn down after a period of inactivity, after which uploaded files and computed results are lost and would need to be re-uploaded or recomputed. [10][13] In the Assistants API version, OpenAI documents that a code interpreter session stays active for one hour by default. [10]
Because the model runs in an interactive Python kernel, it can build up a result across several steps within one session. It might load a spreadsheet in one block of code, clean and reshape the data in a second block, and plot the result in a third, with each step able to use the variables defined by the earlier ones. [2][13] This statefulness is part of why the experience feels conversational: a user can ask a follow-up question and ChatGPT can answer it by running a little more code against the data already in memory rather than starting over. [7]
The feature is most often used for working with data files. A user can upload a CSV or Excel spreadsheet and ask ChatGPT to clean it, merge it with another file, compute summary statistics, or surface patterns, and the model carries out the work by writing and running pandas code. [2][7] It can produce visualizations such as bar, line, pie, and scatter charts, and since the May 2024 update these can be rendered as interactive charts and tables that the user can expand, hover over, recolor, and download for use in documents or presentations. [7]
Other common tasks include mathematics and symbolic or numerical computation, where running code avoids the arithmetic mistakes a language model can make when answering from memory alone. [1][3] The sandbox is also used for file conversion and manipulation, such as changing a file from one format to another, extracting text or tables from documents, editing images, trimming or transcoding media where the necessary libraries are present, and generating downloadable output files. [1][2] Because the environment includes scientific Python libraries, users can run basic machine learning workflows as well, for example fitting a simple model to an uploaded dataset or producing a quick exploratory analysis, within the limits of the sandbox's memory and the absence of specialized hardware. [2][7]
OpenAI itself summarized the original use cases as solving mathematical problems, doing data analysis and visualization, and converting files between formats. [1] Observers described the feature as turning ChatGPT into something like an on-demand data analyst that can take a raw file and return a finished chart or summary in a single conversation. [4]
The appeal for many users is that it lowers the bar for tasks that previously required writing code by hand. Someone who does not know pandas can still ask for a pivot table or a correlation between two columns and get back both the answer and, if they want it, the code that produced it. [7][8] At the same time, the feature inherited the limits of its sandbox, so workflows that depend on calling an external API, querying a live database, or pulling in a fresh dataset from the web do not work inside the environment, since it cannot reach the network. [13]
Access has broadened over time. The feature began as an alpha limited to selected developers and Plus subscribers in March 2023, then reached all Plus users in July 2023. [1][3] After the August 2023 rename, ChatGPT Enterprise customers received unlimited use of the renamed Advanced Data Analysis. [11] In May 2024 OpenAI made data analysis and file uploads available to Free users as well, though Free accounts face stricter rate limits and lower daily caps than paid tiers. [12]
Usage limits apply across tiers. OpenAI's documentation has described hard per-file size limits for uploads, with much smaller effective limits for spreadsheets because each row must be parsed, and it sets different daily upload allowances for Free versus paid accounts. [15] The capability is available through the ChatGPT web app and the iOS and Android mobile apps, and on paid tiers files can be added directly from connected Google Drive and Microsoft OneDrive accounts. [7][15]
OpenAI offers a related tool, also called code interpreter, for developers building on the OpenAI Assistants API. [10] It lets an assistant write and run Python in a sandboxed execution environment, process uploaded files containing varied data and formats, and generate files that include data and images of graphs. [10] The behavior mirrors the consumer feature: the model can iterate on code, reading errors and retrying until the code runs. [10]
The API version is billed by session rather than by token for the tool itself. OpenAI documents a charge of 0.03 US dollars per code interpreter session, with a session active by default for one hour, so repeated calls within the same thread over that hour count as a single billed session. [10] Calling the tool in two separate threads at the same time creates two sessions. [10] This tool is one of several that OpenAI has provided to let developers add file handling and execution to assistant-style applications.
The design treats the sandbox as the security boundary rather than relying on the model to police its own behavior. The environment is firewalled and has no internet access, which limits the damage that generated or injected code could do, since it cannot reach external systems or exfiltrate data over the network. [1][2][13] Security researchers have nonetheless probed the environment and shown that prompt injection and other techniques can lead the model to run unintended commands or reveal details about the container it runs in. [13] In examining these reports, observers noted that the Python interpreter itself was never intended to be a security boundary and that the container is meant to hold nothing sensitive, so escaping the model's instructions within the sandbox does not by itself expose private data. [14]
The practical limitations follow from the sandbox design. There is no internet access, so the model cannot download data or libraries at run time and is restricted to preinstalled packages. [13] The environment is ephemeral, so files and computed state are lost once a session ends. [10][13] Uploads are capped in size, and spreadsheets in particular are limited well below the raw file ceiling because every row is parsed into memory, which constrains how large a dataset the tool can handle in one pass. [15] Available memory and compute are modest, so very large or heavy workloads can fail or run slowly, and the absence of accelerators limits the kind of machine learning that is feasible. [13][14] As with any system that runs model-generated code, output should be checked, because the model can write code that runs successfully yet produces an incorrect result.
Code Interpreter is frequently described as one of the clearest early demonstrations that a large language model could be given a tool and left to use it. [9] Instead of treating the model as a closed system that only emits text, OpenAI paired it with a real Python runtime and let it act, observe, and correct itself. That pattern, generate code, run it, read the result, and try again, anticipated the more elaborate agentic systems and tool-using assistants that followed. [9][8] The feature's later absorption into the default behavior of GPT-4o and subsequent models reflects how quickly code execution moved from a separate opt-in plugin to an ordinary part of what a general-purpose chatbot is expected to do. [7][8]