SQL on CSV / JSON (in-browser SQL)

Paste CSV or JSON tables, write a SQL query and see the result as a text table plus CSV. It runs a built-in SQL engine inside the page, with no database to install.

Use the tool

Why this tool exists

Sometimes the data is a CSV export and the question is a simple one: how many orders per country, which customers appear in both files, what is the top ten by revenue. Opening a spreadsheet for joins gets awkward, and spinning up a database for one question is overkill.

This tool loads your pasted tables into a small SQL engine written for the page. You can use joins, GROUP BY, subqueries and WITH clauses, then copy the answer as CSV. Because the engine runs locally, exports containing customer or finance data are not sent to any server.

How to use it

  1. Paste your data in box 1: CSV with a header row, or a JSON array of objects. Separate several tables with a line of ---.
  2. Start a table with "-- name: users" if you want a name. Otherwise use t1, t2 and so on.
  3. Write your SQL in box 2. Separate several statements with semicolons.
  4. Tick "Append CSV to output" if you want the result as CSV as well, then copy it.

Frequently asked questions

Which SQL features work?

SELECT with expressions, WHERE, all common joins, GROUP BY and HAVING, aggregates, ORDER BY, LIMIT, subqueries, non-recursive WITH, UNION, INTERSECT, EXCEPT, CASE, CAST, plus CREATE TABLE, CREATE VIEW, INSERT, UPDATE, DELETE and DROP. Window functions, recursive CTEs, triggers and date functions are not supported.

How does it differ from SQLite?

Division with / is always true division, text that looks like a number compares as a number, and empty CSV cells become NULL. PRIMARY KEY, UNIQUE and NOT NULL are accepted but not enforced, so duplicates are not rejected.

Is my data uploaded anywhere?

No. The engine runs inside the page, and both your tables and your queries stay in the browser. Closing the tab discards them.

How big can the data be?

It is meant for pasted samples, from a few rows to a few thousand. The whole dataset is parsed in memory in your tab, so very large files will be slow. Use a real database for those.