> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate files and analyze data

> Analyze data, generate files, and build from the results directly in the chat.

Ask Lovable to analyze data, create documents, transform files, and generate downloadable outputs directly in the chat. Lovable writes and runs scripts in an isolated environment, then returns the result as a generated file. Your project's source code is never affected.

You can build on top of the result in the same conversation. After Lovable analyzes your data or generates a file, ask it to create app features based on what it found, for example by turning a spreadsheet into a dashboard or a product spec into a working app flow.

<Note>
  On Lovable Cloud projects, code execution has access to your database only if the `Read database` and `Add data` permissions are set to `Always allow`. See [Lovable Cloud](/integrations/cloud) for more information.
</Note>

## What you can do

Upload a CSV, spreadsheet, or any supported file and ask Lovable to analyze, transform, or combine it with other data sources, such as your database or connected tools.

| Use case            | Example prompt                                                                                  |
| :------------------ | :---------------------------------------------------------------------------------------------- |
| Data analysis       | *Analyze the sales data in my uploaded CSV and tell me the top 5 products by revenue.*          |
| PDF report          | *Generate a PDF report summarizing this quarter's metrics from my database.*                    |
| CSV export          | *Export all orders from the last 30 days as a CSV file.*                                        |
| Data transformation | *Convert the uploaded JSON file to a formatted Excel spreadsheet.*                              |
| Chart generation    | *Create a bar chart showing monthly signups from my users table.*                               |
| Slide deck          | *Create a presentation summarizing the key findings from this dataset.*                         |
| Diagram             | *Generate an architecture diagram for my app as a Mermaid flowchart.*                           |
| Image processing    | *Resize these product images to 800x600 and convert them to WebP.*                              |
| Database query      | *How many users signed up this week? Break it down by day.*                                     |
| Data import         | *Import the uploaded CSV into my products table.*                                               |
| Connected tools     | *Read my open Linear issues and generate a status report as a PDF.*                             |
| Build from a file   | *Turn this Excel tracking sheet into a web app with dashboards and user login.*                 |
| Build from a spec   | *Read this PDF product spec, summarize the requirements, and build the first version.*          |
| Build from analysis | *Analyze my user drop-off data, then build an improved onboarding flow based on what you find.* |

## How it works

Describe what you need in the chat. You do not need to configure commands, write scripts, or choose tools yourself. Lovable decides when to run code and when to build features based on your request.

Lovable typically follows this flow:

1. It reads the files, data, or context you provide.
2. It writes and runs the scripts needed to complete the task.
3. It checks the result and fixes issues before delivering, for example layout problems in PDFs or missing data in generated files.
4. It returns the result as inline analysis, a generated file, or both.
5. It keeps that context in the same conversation so you can refine the output or build on it.

The more specific you are about structure, formatting, tone, data sources, and the result you want, the better the output will be.

## What Lovable can run

Lovable writes and executes scripts in an isolated Linux environment. If something can run in a Linux shell, Lovable can likely run it.

Common tools are preinstalled, for example:

| Category        | Examples                           |
| :-------------- | :--------------------------------- |
| Languages       | Python 3, Node.js, Bun, Deno, Bash |
| Data processing | pandas, NumPy, SciPy, DuckDB       |
| Visualization   | matplotlib, Pillow                 |
| Database        | psql for database access           |
| Utilities       | curl, jq, and standard Unix tools  |

If a task needs an additional package or command line interface (CLI) tool, Lovable can install it automatically.

## Supported file types

Lovable can read files you upload and generate new files in the following formats:

| Category      | Formats                               |
| :------------ | :------------------------------------ |
| Documents     | PDF, DOCX, PPTX, TXT, Markdown        |
| Spreadsheets  | CSV, XLSX, XLS                        |
| Images        | PNG, JPEG, WebP, SVG, GIF, AVIF, HEIC |
| Video         | MP4                                   |
| Audio         | MP3, M4A                              |
| Code and data | HTML, JSON, JS, TS, Python            |
| Diagrams      | Mermaid                               |
| Archives      | ZIP, GZIP, TAR                        |

Maximum file size for uploads and downloads is **20 MB**.

## Manage generated files

When Lovable creates a file, it appears in the chat as a file card. You can open it directly from the chat, or open the **Files** tab to search, preview, and download all files created in your project, or reference a file directly in the chat.

You can refine generated files through follow-up prompts. When a file is revised, Lovable creates and stores a new version (for example, `report_v2.pdf`) so you can compare them.

Files are securely and permanently stored with the project. If you want to delete a file, ask Lovable.

## Tips for best results

* **Be specific about formatting**\
  *"Create a PDF report with a cover page, section headers, and a summary table"* produces better results than *"Make a report"*.
* **Name your output**\
  If you want a specific filename, ask Lovable to add it, for example *"Save it as `q1-summary.pdf`."*
* **Iterate**\
  If the first result is not perfect, describe what to change. Lovable keeps context from prior outputs.
* **Chunk large datasets**\
  For very large files, ask Lovable to process a subset first, then scale up.
* **Use connected tools as data sources**\
  Ask Lovable to pull data from tools like Slack, Linear, or Notion, for example *"Summarize the last 50 messages from my Slack feedback channel and generate a report"*.
* **Combine steps**\
  You can ask for analysis and file generation in one prompt, for example *"Analyze this CSV and export the top 10 rows as an Excel file."*
