Answering a question like "which city brought the most revenue last month" from a CSV normally means importing it into a database or building a pivot table. This tool loads the CSV into an in-browser SQL engine (AlaSQL) so you can write a normal SELECT with WHERE, GROUP BY, ORDER BY, COUNT, SUM or AVG and see the result as a table, then download it as CSV.
Paste the CSV, write the query using FROM ? as the table name and click Execute. The engine runs inside your browser tab, so sales, HR or customer files are never uploaded to a server.
How to use Query CSV with SQL step by step
Paste your CSV in the data box, replacing the sample orders table. The first line must contain the column names.
Write the SQL query in the query box. The CSV is referenced as ? (question mark), for example SELECT * FROM ? WHERE amount > 100.
Click "Execute query". The result appears as a table below; errors in the SQL are shown in red.
Click "Download CSV" to save the result as query_result.csv.
Input and output example
Input
order_id,customer,city,amount
1001,Ana López,Madrid,120.50
1002,John Smith,London,89.90
1004,Luis García,Madrid,65.25
SELECT city, COUNT(*) AS orders, SUM(amount) AS revenue FROM ? GROUP BY city ORDER BY revenue DESC
Output
city | orders | revenue
Madrid | 2 | 185.75
London | 1 | 89.9
Why use our Query CSV with SQL?
100% free and online: no payments, no software or extensions to install.
Privacy-first: processing happens in your browser, your data never leaves your device.
No sign-up: paste your data and get the result in one click.
Fast and reliable: handle small or large files in seconds, ready for Excel and other tools.
Common use cases
Aggregate an orders export from Shopify or Stripe by country or month without opening Excel.
Filter a large log or event CSV to the rows that match a condition before sharing it.
Check for duplicates or count distinct values in a mailing list with SELECT email, COUNT(*) ... HAVING COUNT(*) > 1.
Prototype a query against sample data before running it on the production database.
Limits and tips
Cells that look like numbers (123, -4.5) are converted to numbers so SUM, AVG and numeric ORDER BY work; everything else, including dates, is text.
Quoted fields are supported: a value such as "López, Ana" stays in one column. The separator must be a comma.
AlaSQL supports most of SQL-92 SELECT syntax: JOIN between two datasets is not available here because only one CSV is loaded, but subqueries, CASE, LIKE, IN, BETWEEN, DISTINCT, LIMIT and string functions such as UPPER, LOWER, SUBSTRING work.
Column names with spaces or accents must be wrapped in backticks or square brackets, for example SELECT [unit price] FROM ?.
Frequently asked questions
Why is the table called ? in the query?
The CSV rows are passed to the SQL engine as a parameter, and AlaSQL uses a question mark as a placeholder for a data source passed this way. Write FROM ? wherever you would write the table name; you can alias it with FROM ? AS t if you prefer.
Which SQL functions are supported?
The engine is AlaSQL, a JavaScript SQL database. It supports SELECT with WHERE, GROUP BY, HAVING, ORDER BY, LIMIT and OFFSET; aggregates COUNT, SUM, AVG, MIN, MAX; DISTINCT; CASE expressions; LIKE, IN and BETWEEN; and string and math functions such as UPPER, LOWER, TRIM, LENGTH, ROUND and ABS.
Why does SUM return 0 or a concatenated string?
Because the column contains values that are not plain numbers, for example 1,200.50 with a thousands separator, a currency symbol, or spaces. Only cells matching a plain decimal such as 1200.50 are converted to numbers. Clean the column first, or use CAST in the query.
What is the difference between running SQL on a CSV and in a database?
A database stores the data permanently, enforces types and indexes and can join many tables. Here the CSV is loaded into memory for one session and every column is text or number by inference, which is ideal for quick exploration but not for persistent or multi-table work.
Is the CSV sent to a server?
No. Parsing and query execution happen in JavaScript inside your browser. The data is discarded when you close or reload the page.