convert-csv.com logo convert-csv.com

Query CSV via SQL

Run SQL SELECT queries against your CSV in the browser and export the result.

100% Secure - your files are processed in your browser and never sent to a server.
Drop your file hereor click to browseSupports CSV, TSV, XLS, XLSX, JSON, XML, YAML, SQL, KML, GeoJSON (Max 100MB)

How to query CSV with SQL

  1. Load your CSV data: Pick a file from your computer or paste text into the upload box.
  2. Check your columns: The schema panel on the right shows the fields you can use in your queries.
  3. Write your SQL: Use standard SELECT syntax. The table name is CSV_DATA (e.g., SELECT * FROM CSV_DATA WHERE age > 21).
  4. Pick your output format: Choose CSV, JSON, or Excel for the query results.
  5. Run the query: Click "Execute Query", then copy or download the results.

Frequently asked questions

How do I query my CSV file using SQL?
Pick a CSV file with drag-and-drop or the file picker, or paste your CSV data. The tool shows the columns it found. Write a SQL SELECT query in the editor and click "Execute Query".
Do I need a server or database to run these queries?
No. Everything runs in your browser using an in-memory SQL database (Alasql) inside a Web Worker. Your data stays private and never leaves your machine.
Can I perform JOINs or GROUP BY operations?
Yes. You can write full SELECT statements with GROUP BY, HAVING, ORDER BY, aggregations like COUNT, SUM, AVG, and subqueries. Since everything runs over a single in-memory table, you can reference multiple tables by mapping them.

Related tools