SQL Query on CSV

Treat CSV and Excel files as tables and query them with SQL — filter, group, join several files and export the result, all in your browser.

or drop a file anywhere
Loading the tool…
About this tool

What the SQL Query on CSV does

Spreadsheets are great until you need to filter on three conditions, total by two columns and join with another file. SQL does that in one readable statement. Load one or more CSV, TSV, JSON or Excel files and each becomes a table named after the file (sales_2025.csv becomes sales_2025); every sheet of a workbook becomes its own table.

The query engine is written for this site and runs entirely in JavaScript. It supports what analysts use every day: SELECT with DISTINCT and aliases, WHERE with AND/OR, IN, BETWEEN, LIKE and IS NULL, GROUP BY with HAVING, ORDER BY and LIMIT/OFFSET, INNER, LEFT, RIGHT and FULL joins, UNION, sub-queries, WITH (common table expressions), CASE expressions, window functions such as ROW_NUMBER, RANK, LAG, LEAD and running SUM … OVER, and about seventy functions for text, numbers and dates — including strftime, DATE_TRUNC and EXTRACT.

Queries are read-only: INSERT, UPDATE and DELETE are refused, so your data cannot be changed by mistake. Results can be downloaded as CSV or JSON, or sent straight to the chart builder.

How to use it

  1. Upload one or more CSV/Excel files (or pick a sample). Each appears under Tables with its columns.
  2. Write a query, or click an example to start from one. Click a table or column name to insert it.
  3. Press Run query or Ctrl + Enter.
  4. Download the result as CSV or JSON, or click “Chart the result”.

Example

Input
SELECT region, SUM(revenue) AS total
FROM sales
WHERE month >= '2025-07'
GROUP BY region
ORDER BY total DESC;
Result
region | total
East   | 3330473
North  | 2841456
South  | 2364176
West   | 2034845
(4 rows, using the fictional sales sample)

When to use it

  • Answering questions about an export without importing it into a database.
  • Joining two spreadsheets on a shared ID column (a VLOOKUP replacement).
  • Practising SQL on your own data.

Tip: Column names with spaces or punctuation need double quotes: SELECT "Order ID" FROM orders. Text values use single quotes: WHERE city = 'Pune'.

Real SQL, in the browser

Joins, GROUP BY, HAVING, sub-queries, CTEs, CASE, UNION and window functions — with clear error messages pointing at the problem.

Several files at once

Upload multiple CSV or Excel files and JOIN them; each file or sheet is a table.

Typed columns

Numbers, dates and booleans are detected so comparisons, SUM() and date functions just work.

Export & chart

Download results as CSV or JSON, or chart them with one click.

Privacy: how your data is handled

Files you open here are read with your browser’s File API and processed by JavaScript on this page. They are not uploaded to SnipFerry or to anyone else, and nothing is stored after you close the tab. Map outlines are served by SnipFerry itself; only the optional OpenStreetMap street basemap loads tiles from a third party, and only for the area you are viewing.

FAQ

Common questions

Which SQL dialect is this?

It follows standard SQL with SQLite-style conveniences: loose typing, || for concatenation, strftime() and date() for dates, LIMIT/OFFSET, and also accepts TOP n, DATE_TRUNC, EXTRACT(… FROM …), ILIKE and :: casts familiar from SQL Server and PostgreSQL.

Can I join two CSV files?

Yes. Upload both files, then use JOIN … ON with the shared column, for example SELECT * FROM orders o JOIN customers c ON o.customer_id = c.id. Equality joins are indexed, so they stay fast with large files.

Can I modify the data with UPDATE or DELETE?

No. The tool is read-only by design. To change data, write a SELECT that produces the new version (for example with CASE expressions) and download the result.

How large can the files be?

Hundreds of thousands of rows work well; a GROUP BY over 200,000 rows typically takes a fraction of a second. The limit is your browser’s memory.

Is my data sent to a database server?

No. The SQL engine runs in your browser tab, and your files never leave your device.