Start a project

Tool 59 of 100 · Data

CSV SQL Query

Drop in one or more CSV files and query them with SQL: filter, join, group and sort, without a database and without your data leaving the device.

CSV SQL Query at a glanceIllustration: 1, CSV files; 2, processed in your browser; 3, SQL results.CSV SQL Query1CSV files</>3SQL results2In yourbrowser
1 CSV files 2 processed on your device 3 SQL results

CSV SQL Query

Tables

Query

Result

Result as CSV
Result as JSON

01

What it does

Loads CSV files as tables and runs SELECT queries with joins, grouping and functions, then exports the result as CSV or JSON.

  • Several CSV files as tables at once
  • WHERE, JOIN, GROUP BY, HAVING, ORDER BY and LIMIT
  • COUNT, SUM, AVG, MIN, MAX and DISTINCT
  • CASE, LIKE, IN, BETWEEN and string or date functions

02

Private by design

Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

03

What you get

Query results as CSV or JSON, with a Copy and a Download button on every result.

  • CSV
  • SQL
  • Data

Why it matters

A CSV export is often the quickest way to answer a question about your data: orders by month, customers in two lists, the slowest pages in a report. Spreadsheets struggle with joins and grouping, and loading a database for one question is overkill.

This tool reads CSV files as tables and runs a real SQL engine, written for this site, in your browser. Exports with customer data never leave your device, and anyone who knows a little SQL can join, group and filter thousands of rows in a second.

How it works

  1. InputOne or more CSV files and a SELECT
  2. In your browserRun by an SQL engine in the page
  3. OutputA results table and CSV

Where it fits in a designer's workflow

  1. Plan
  2. Design
  3. Build
  4. Test
  5. Launch
Answering questions about exports without a database.

By the numbers

Rows returned by each example queryGroup and total: 2 rows out of 7 scanned; Left join: 7 rows out of 7 scanned; By month: 4 rows out of 7 scanned; Filters: 3 rows out of 7 scanned; Distinct: 3 rows out of 7 scannedGroup and total2 rows out of 7 scannedLeft join7 rows out of 7 scannedBy month4 rows out of 7 scannedFilters3 rows out of 7 scannedDistinct3 rows out of 7 scanned
Run with this tool's own SQL engine on its two sample CSV files (7 orders). It supports joins, GROUP BY with HAVING, ORDER BY, DISTINCT and functions, all in the browser, so a spreadsheet export can be queried without a database. Source: SQLite: SELECT.
Show the numbers as a table
QueryRows returnedRows scanned
Group and total27
Left join77
By month47
Filters37
Distinct37

How to use it

  1. Load one or more CSV files, or use the sample tables.
  2. Write a SELECT query using the table names shown.
  3. Run it and check the results.
  4. Download the results as CSV or JSON.

FAQ

Which SQL can I use?

SELECT with WHERE, inner and left JOIN, GROUP BY, HAVING, ORDER BY, LIMIT and OFFSET, DISTINCT, CASE and common functions. It doesn't change the data.

How are column types decided?

Each value is read as a number when it looks like one, otherwise as text. Empty cells are NULL.

How big can the files be?

Tens of thousands of rows work smoothly. Very large files depend on your device's memory.

Is my data uploaded?

No. Files are read and queried on your device.

Work with me

Want a site that gets these right?

I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

All developer tools · Back to leej.uk