JSONL SQL Playground
JSONL SQL playground. Run SQL on a JSONL (JSON Lines) file directly in your browser via DuckDB-WASM. SELECT, JOIN, GROUP BY and window functions. Your data is registered as the table data. Up to 1 GB, nothing uploaded.
Query
Why SQL on JSONL
When you need joins, aggregates, or window functions, SQL is faster to write than jq.
DuckDB reads JSONL natively, so you can SELECT COUNT(*) FROM data WHERE plan='pro' on a 500 MB file without any setup.
Nothing leaves your browser — DuckDB-WASM runs locally.
Before you start
The SQL playground registers your JSONL as a virtual table called data. Once it's loaded, you write SQL against it like any other table. The query engine is DuckDB-WASM, which downloads once (~10 MB) on first use and stays cached.
How to use it
- Drop a JSONL file or paste records into the JSONL data pane.
- Edit the SQL pane. The example query is a starter.
- Click Run query. Results appear in the Result textarea as JSONL.
- Pick an export format (CSV, JSONL, or SQL INSERT) and click Download result or Copy result.
SQL features (DuckDB dialect)
- All the basics:
SELECT,WHERE,GROUP BY,ORDER BY,LIMIT. JOINworks if you register multiple files — re-run with different data to chain queries.- Window functions:
ROW_NUMBER() OVER (PARTITION BY …). - Aggregates:
COUNT,SUM,AVG,MIN,MAX,MEDIAN,QUANTILE. - Nested-JSON access:
data.user.email, ordata -> 'user' ->> 'email'for explicit JSON ops. - CTEs:
WITH … AS (SELECT …) SELECT * FROM ….
Example queries
Top plans by revenue:
SELECT plan, COUNT(*) AS n, SUM(mrr) AS revenue
FROM data
GROUP BY plan
ORDER BY revenue DESC;
First record per user:
SELECT *
FROM (
SELECT *, ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY created_at) AS rn
FROM data
) WHERE rn = 1;
Records where a nested key matches:
SELECT id, user.email
FROM data
WHERE user.country = 'DE';
Tips & common pitfalls
- First query is slow — DuckDB-WASM has to download (~10 MB) and parse the file. Subsequent queries on the same data are fast.
- Schema is inferred once when the table is created. If your data has wildly different shapes per record, DuckDB may widen to
VARCHARor fail to parse. - For pure filtering and slicing, the jq playground is faster to type. Use SQL when you need aggregates, joins or windows.
- Export as SQL INSERT if you want to load the result straight into Postgres / MySQL / SQLite.
Frequently asked questions
How big a file can it handle?
Hundreds of MB are comfortable. Above 1 GB you're fighting the browser tab's memory cap.
What SQL dialect is this?
DuckDB. Most PostgreSQL syntax works; a few features (like RETURNING) don't apply because there's no real table.
Why do I need to click "Run query" again after editing data?
The data is re-registered each run so DuckDB picks up your edits. If you want to keep the same data across queries, just don't edit it between runs.