- Created by Jason Taylor on 2026-02-19 7 minute read
Using Data Analysis in ChatGPT
Overview
ChatGPT includes a built-in data analysis capability that lets you upload structured data files and explore them using plain English. Behind the scenes, ChatGPT writes and executes Python code in a secure, sandboxed environment — but you never need to write code yourself. You describe what you want to know, and ChatGPT handles the rest: loading the data, running calculations, generating charts, and returning results directly in the conversation.
This makes ChatGPT a practical tool for anyone who works with data, whether you are a researcher analyzing survey results, a staff member reviewing enrollment figures, or a student working through a statistics assignment.
How It Works
When you upload a data file to ChatGPT, the following process happens automatically:
- ChatGPT examines your data. It reads the first several rows to understand the structure — column names, data types, and the general shape of the dataset. An interactive table view is automatically created, allowing you to scroll through your data.
- You ask questions in natural language. Prompts like "What's the average GPA by major?" or "Show me enrollment trends over the last five years" are all it takes.
- ChatGPT writes and runs Python code. Using libraries like pandas for data manipulation and Matplotlib for visualization, it generates code, executes it in a secure environment, and returns the results.
- You iterate. Each follow-up question builds on the previous analysis. You can refine filters, request different visualizations, ask for deeper breakdowns, or export results — all within the same conversation.
You can view the Python code ChatGPT used at any time by clicking the View Analysis link that appears at the end of a response. This is useful for verifying the logic, learning from the approach, or copying the code to use in your own environment.
Supported File Types
ChatGPT can analyze data from a variety of file formats:
- CSV (.csv) — the most common and reliable format for tabular data
- Excel (.xlsx, .xls)
- TSV (.tsv)
- JSON (.json)
- XML (.xml)
- SQLite databases (.sqlite, .db)
- Parquet (.parquet)
- Text files (.txt) containing structured data
- PDF — ChatGPT can extract tables and data from PDFs, though results vary depending on how the PDF was generated
For best results, use CSV or Excel files with clean headers and consistent formatting. Files can be up to 512 MB, though CSV and spreadsheet files are practically limited to about 50 MB depending on row size.
You can also connect files directly from Google Drive or Microsoft OneDrive instead of downloading and re-uploading them.
What You Can Do
Explore and Summarize Data
Upload a file and ask ChatGPT to describe it. It will report the number of rows and columns, list column names and data types, identify missing values, and provide basic summary statistics. This is a great first step with any unfamiliar dataset.
Example prompts:
- "Describe this dataset — what columns are there and what do they contain?"
- "How many rows have missing values? Which columns are affected?"
- "Give me summary statistics for all numeric columns."
Clean and Transform Data
ChatGPT can handle common data-cleaning tasks: removing duplicates, filling or dropping missing values, renaming columns, converting data types, filtering rows, and restructuring data for analysis.
Example prompts:
- "Remove any rows where the email column is blank."
- "Convert the date column from text to a proper date format."
- "Split the full_name column into first_name and last_name."
- "Pivot this data so each department is a column and each month is a row."
Perform Calculations and Aggregations
From simple sums and averages to grouped aggregations and cross-tabulations, ChatGPT can compute what you need without writing formulas.
Example prompts:
- "What's the total revenue by region?"
- "Calculate the average response time grouped by ticket priority."
- "Show me a month-over-month percentage change in enrollment."
- "Merge these two files on the student_id column and show me the combined result."
Run Statistical Analysis
ChatGPT can perform a range of statistical analyses, selecting appropriate techniques based on your data and your question. It supports descriptive statistics, correlations, regressions, hypothesis testing, and more.
Example prompts:
- "Is there a correlation between study hours and GPA in this dataset?"
- "Run a linear regression with GPA as the dependent variable and study_hours, attendance_rate as independent variables."
- "Perform a t-test comparing average scores between Group A and Group B."
- "Calculate the median and standard deviation for each numeric column."
Create Visualizations
ChatGPT can generate both static and interactive charts. You can let it choose the best chart type for your data, or specify exactly what you want.
Supported chart types:
| Interactive | Static Only |
|---|---|
| Bar chart | Histogram |
| Line chart | Box plot (box-and-whisker) |
| Pie chart | Heat map |
| Scatter plot | Area chart |
| Radar chart | |
| Treemap | |
| Bubble chart | |
| Waterfall chart |
Interactive charts allow you to hover over data points, zoom, and explore the data visually. You can toggle between static and interactive views using the switch in the top-right corner of any chart.
Charts can be customized — you can change colors (including by hex code), adjust labels, and modify layouts by asking in plain language. Charts can be downloaded as PNG images for use in presentations or reports.
Example prompts:
- "Create a bar chart showing total headcount by department."
- "Show me a line chart of monthly ticket volume over the last two years."
- "Make a scatter plot of study_hours vs. GPA, color-coded by major."
- "Generate a heat map of correlations between all numeric columns."
Work with Tables
When you upload structured data, ChatGPT automatically creates an interactive table view. You can scroll through your data, select specific rows or columns, and ask follow-up questions about the selected data. You can also ask ChatGPT to create new tables, add calculated columns, or restructure existing ones.
Tables can be downloaded as CSV files for use in other applications.
Merge Multiple Datasets
If you upload more than one file, ChatGPT can automatically merge them based on shared identifiers. For example, if you have one spreadsheet of students and another of course enrollments linked by a student ID, ChatGPT can join them and answer questions across both datasets.
Example prompts:
- "Merge these two files on student_id and show me students who appear in both."
- "Join the sales data with the product catalog on product_code and calculate revenue by category."
Practical Use Cases
For Researchers
Upload survey results or experimental data and ask for descriptive statistics, visualizations, correlation matrices, or regression analyses. ChatGPT can help you explore your data before moving to more specialized tools like R or SPSS for final analysis.
For Staff and Administrators
Analyze enrollment trends, budget data, help desk ticket volumes, HR metrics, or event attendance. Generate charts and summary tables you can drop directly into reports or presentations.
For Faculty
Upload grade distributions to identify patterns, analyze assignment scores across sections, or explore student performance data. Create visualizations for department meetings or accreditation reports.
For Students
Work through statistics assignments, explore datasets for class projects, or learn data analysis concepts by watching how ChatGPT approaches problems. Use Study Mode alongside data analysis to get step-by-step explanations of statistical techniques.
Tips for Getting Good Results
Start with clean data. The cleaner and more consistently formatted your data is, the better ChatGPT will perform. Clear column headers, consistent date formats, and minimal junk rows go a long way.
Be specific about what you want. "Analyze this data" will give you generic summary statistics. "Show me the top 10 departments by average salary, sorted descending, as a horizontal bar chart" will give you exactly what you need.
Iterate in the same conversation. Each follow-up builds on previous context. Ask a broad question first, then drill down into specifics. ChatGPT retains your dataset throughout the session.
Verify important results. Click "View Analysis" to inspect the Python code and confirm the logic. For high-stakes decisions, validate key findings using a second tool or method.
Use Projects for recurring analyses. If you regularly analyze similar data (e.g., monthly reports), set up a Project with custom instructions describing your preferred format, metrics, and terminology. This saves time and produces more consistent output.
Export and save your work. Download charts as PNGs and tables as CSVs. ChatGPT does not persist your data between sessions — uploaded files are deleted after the conversation ends (the retention duration varies by plan).
Limitations
- No live database connections. ChatGPT cannot connect directly to a database, API, or live data source. You need to export your data to a file and upload it.
- No outbound network access during analysis. The code execution environment is sandboxed and cannot make external HTTP requests or access the internet.
- Large datasets may hit limits. Very large files can exceed memory or token limits in the execution environment. If this happens, try filtering your data to the relevant subset before uploading, or split the analysis across multiple conversations.
- Results require verification. ChatGPT may occasionally produce incorrect calculations, misinterpret column names, or choose inappropriate statistical methods. Always review outputs critically, especially for work that will inform decisions.
- Visualizations are generated, not interactive dashboards. ChatGPT produces charts within a conversation but does not create persistent, auto-refreshing dashboards. For ongoing reporting needs, consider purpose-built tools like Grafana, Tableau, or Power BI.
- Data sensitivity. Follow university data governance policies when deciding what to upload. Do not upload data classified as sensitive or restricted unless your institutional policy explicitly permits it.
Getting Started
To try data analysis in ChatGPT Edu:
- Open a new conversation (or an existing Project).
- Click the attachment icon or drag and drop a CSV, Excel, or other supported file into the chat.
- Wait for ChatGPT to load and display the interactive table.
- Start asking questions about your data in plain English.
For more information about ChatGPT Edu access and features, see the related articles in this knowledge base.
- No labels