SQL

Query CSV with SQL

Load one or more CSV files as SQLite tables and ask them anything: filter, join, group and rank, then export the answer as a new CSV.

or Ctrl + Enter

No tables yet. Open a CSV file to create one.

Query results appear here.

How it works

Every file you open becomes a table named after the file: Sales 2026.csv becomes sales_2026. Click a table to see its columns and types; click a column name to insert it into the query.

  • Simplify column names turns headers such as Unit Price (€) into unit_price. Untick it to keep the original names and quote them as "Unit Price (€)".
  • Store dates as ISO text rewrites 05/03/2026 as 2026-03-05 so dates sort correctly and work with strftime.

Need INSERT statements rather than query results? CSV Lark's CSV to SQL converter writes them.

Frequently asked questions

Which SQL dialect does it use?

SQLite 3, compiled to WebAssembly (sql.js) and loaded only when you open a file. Joins, GROUP BY, window functions, common table expressions and date functions such as strftime all work.

How are column types chosen?

Columns whose values are all numbers become INTEGER or REAL, with thousands separators, decimal commas, currency signs and percent signs removed. A column that mixes numbers and text stays TEXT so nothing is lost, and empty cells become NULL.

Can I query several files together?

Yes. Each file becomes its own table, named after the file, so you can JOIN them, UNION them or use one as a lookup for another.

Are my queries or files sent anywhere?

No. The database lives in your browser's memory and disappears when you close the tab.