ChatGPT isn't just for words and images. With Code Interpreter, it can run actual code, process data files, generate charts, and deliver analysis that would normally require Python, Excel, or a data analytics tool.
Upload a CSV, ask a question about your data, and get back a chart with insights β all without writing a single line of code yourself. Today you'll learn how Code Interpreter works, what file types it supports, and how to go from raw data to presentation-ready visualizations.
Code Interpreter is a built-in ChatGPT feature that executes Python code in a secure, sandboxed environment. You don't need Python installed on your computer. You don't need to know Python at all. ChatGPT writes and runs the code for you.
What happens behind the scenes:
1. You describe what you want or upload a file
2. ChatGPT writes Python code to accomplish the task
3. The code runs in a sandboxed environment (isolated, secure, temporary)
4. Results are returned β data, charts, files, or text output
5. You can download any generated files
What Code Interpreter can do:
- Data analysis β Statistical calculations, trend analysis, correlations, outlier detection
- Visualizations β Bar charts, line graphs, scatter plots, heatmaps, pie charts, and more
- File conversion β Convert between formats (CSV to Excel, JSON to CSV, PDF table extraction)
- Math and calculations β Complex formulas, financial modeling, scientific computations
- Text processing β Clean messy data, extract patterns, parse log files
- Image processing β Resize, crop, convert formats, create composites
- File generation β Create PDFs, spreadsheets, presentations, and other downloadable files
The sandbox is temporary β files exist only during your session. Download anything you want to keep before ending the conversation.
Code Interpreter can process a wide variety of file types. Here's what you can upload and what ChatGPT can do with each:
Spreadsheets and data files:
- CSV files β The most common format. ChatGPT reads every row and column instantly.
- Excel files (.xlsx, .xls) β Full support including multiple sheets, formulas, and formatting.
- JSON files β Structured data from APIs and web applications.
- TSV files β Tab-separated values, common in scientific data.
Documents:
- PDF files β ChatGPT can extract text, tables, and data from PDFs.
- Text files (.txt, .log) β Log files, raw data exports, plain text.
Images:
- PNG, JPG, SVG β For image processing, chart recreation, or visual analysis.
Code files:
- .py, .js, .sql, .html, .css β Upload code for analysis, debugging, or conversion.
How to upload:
Click the paperclip icon in the message bar, select your file, and add your instruction. For example: "Here's our Q4 sales data. Show me the top-performing products and create a chart."
Important limits to know:
- Maximum file size varies by plan (typically up to 512 MB)
- The sandbox has standard Python data libraries pre-installed (pandas, matplotlib, numpy, seaborn, scipy, and more)
- Files are temporary β download results before ending your session
This is where Code Interpreter truly shines. You can go from raw data to beautiful, presentation-ready charts in seconds.
Chart types available:
- Bar charts β Compare categories (sales by region, revenue by product)
- Line charts β Show trends over time (monthly growth, stock prices)
- Scatter plots β Reveal correlations (ad spend vs. revenue, hours studied vs. grades)
- Pie/Donut charts β Show composition (market share, budget allocation)
- Heatmaps β Visualize density and patterns (user activity by hour, correlation matrices)
- Histograms β Show distribution (customer age groups, order values)
- Box plots β Display statistical spread (salary ranges by department)
- Stacked/Grouped bar charts β Multi-variable comparisons
Customization options:
You can ask for specific colors, labels, titles, fonts, sizes, and styles. Want your company's brand colors? Just specify them. Need a chart for a dark-mode presentation? Ask for a dark background with light text.
Pro tip: Ask ChatGPT to generate charts that are "presentation-ready" β this triggers higher-quality formatting with proper titles, axis labels, legends, and clean spacing that you can drop directly into a slide deck.
Let's walk through a complete real-world workflow to show how all these pieces fit together.
Scenario: You're a marketing manager and your boss asks, "How did our campaigns perform last quarter? I need a summary for the board meeting tomorrow."
Step 1: Upload your data
Upload your campaign performance CSV with columns for campaign name, channel, spend, impressions, clicks, conversions, and revenue.
Step 2: Ask for an overview
"Summarize this dataset. How many campaigns ran? What was the total spend and revenue? What was the overall ROI?"
Step 3: Request specific analysis
"Which 3 campaigns had the highest ROI? Which channel performed best overall? Are there any campaigns where we spent a lot but got poor results?"
Step 4: Generate visualizations
"Create a chart showing ROI by channel, a scatter plot of spend vs. revenue for each campaign, and a bar chart of the top 10 campaigns by conversions. Presentation-ready, use blue as the primary color."
Step 5: Get a written summary
"Write a 200-word executive summary of the key findings that I can paste into the board presentation."
Step 6: Download everything
Download the charts as PNG files and the summary as a text file. Drop them into your slide deck.
Total time: About 5 minutes, compared to the hours it would take to do this manually in Excel or a BI tool.