# SQL on CSV

> Query CSV files with SQL, powered by in-browser SQLite. Runs entirely in your browser — nothing is uploaded.

Source: https://toffeekit.com/tools/sql-on-csv

**Category:** [Data](https://toffeekit.com/category/data) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/sql-on-csv

**Also useful for:** sql, sqlite, csv, query, join, group by, database, select

## How it works

1. Click Add CSV files, or drop files on the Tables panel. Each file becomes a table named after it.
2. Write a query in the Query box, or open Examples for ready-made ones such as Top 10 or Group by.
3. Click Run, or press Ctrl or Command and Enter. Select part of the text to run only that.
4. Review the result table, then click Export CSV to save it.

## FAQ

### How do I query a CSV file with SQL?

Add the file and it becomes a table. Then write a normal SELECT, such as SELECT * FROM my_table LIMIT 10, and click Run.

### Can I join two CSV files?

Yes. Add both files and join the tables on a shared column. The built-in sample loads a customers file and an orders file and joins them to total revenue by country.

### Which SQL dialect does it use?

SQLite, running in your browser. Standard SELECT, JOIN, GROUP BY, window functions and common functions like ROUND and strftime are available.

### How big can the CSV files be?

Up to 80 MB per file. Larger files are refused because the whole database is held in browser memory.

### Can I save the query result?

Yes. Click Export CSV above the results to download them as a file.

### Is SQL on CSV free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so your files are processed on your device and never uploaded. It works on phones and computers alike.

## Privacy

SQL on CSV runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [CSV to JSON](https://toffeekit.com/tools/csv-to-json) — Turn CSV rows into JSON objects.
- [JSON to CSV](https://toffeekit.com/tools/json-to-csv) — Flatten JSON into a CSV you can open in Excel.
- [XML ⇄ JSON](https://toffeekit.com/tools/xml-json-converter) — Convert XML to JSON and back.
- [CSV Cleaner](https://toffeekit.com/tools/csv-cleaner) — Trim cells, drop empty rows, remove duplicates.
- [Delimiter Converter](https://toffeekit.com/tools/csv-delimiter-converter) — Switch between comma, semicolon, tab and pipe.
- [CSV Viewer](https://toffeekit.com/tools/csv-viewer) — Open a CSV as a sortable, searchable table.

