SQL Playground
Run SQL queries in your browser with SQLite. Import CSV files, create tables, export results. Free online SQL editor and database sandbox
A SQL playground that runs in your browser using SQLite via WebAssembly means you can test queries against your own data without spinning up a database server. Drop a CSV; it becomes a table. Drop a SQLite file; it opens. Write SELECTs, CREATEs, UPDATEs — all runs locally. This is the right way to evaluate ideas before deploying to a real database: SQLite supports 95% of the SQL syntax you actually use, runs millions of rows in the browser, and never leaks data to a server.
What SQLite-in-browser actually does
- SQLite WASM (~ 1MB) loaded on demand. Same SQLite binary used in Android, iOS, Firefox, Chrome internals. ACID-compliant, full SQL support including window functions, CTEs, JSON1, FTS5.
- Tables backed by IndexedDB or in-memory. In-memory is faster but lost on page refresh; IndexedDB persists across sessions in the same browser.
- CSV import via SQL: CREATE VIRTUAL TABLE csv USING csv('data.csv', header=true). Or paste CSV and the tool creates the table.
- JSON, XML, and Parquet imports via separate extensions.
- Export results as CSV, JSON, or paste-ready SQL INSERT statements.
- Performance: row-store SQLite at ~100k-1M inserts/sec in browser, similar SELECT performance. Practical limit ~10-100M rows before browser memory becomes the issue.
Working example: analyzing a CSV of orders
Input
Imported CSV: orders.csv (50,000 rows, columns: id, customer_id, amount, currency, status, created_at)
Output
-- Top 10 customers by total spend
SELECT
customer_id,
COUNT(*) AS order_count,
SUM(amount) AS total_spend,
ROUND(AVG(amount), 2) AS avg_order
FROM orders
WHERE status = 'completed'
AND created_at >= '2025-01-01'
GROUP BY customer_id
ORDER BY total_spend DESC
LIMIT 10;
-- Monthly trend
SELECT
strftime('%Y-%m', created_at) AS month,
COUNT(*) AS orders,
SUM(amount) AS revenue
FROM orders
WHERE status = 'completed'
GROUP BY 1
ORDER BY 1;
-- Daily new vs returning customers
WITH first_order AS (
SELECT customer_id, MIN(created_at) AS first_dt
FROM orders WHERE status = 'completed'
GROUP BY customer_id
)
SELECT
DATE(o.created_at) AS day,
SUM(CASE WHEN DATE(o.created_at) = DATE(fo.first_dt) THEN 1 ELSE 0 END) AS new_cust,
SUM(CASE WHEN DATE(o.created_at) > DATE(fo.first_dt) THEN 1 ELSE 0 END) AS returning
FROM orders o
JOIN first_order fo USING (customer_id)
GROUP BY 1;CTEs and window functions work the same as in Postgres / MySQL. Date arithmetic uses SQLite's strftime (not Postgres date_trunc). For migrating queries between dialects, this is the most common point of friction.
SQLite vs Postgres vs MySQL for prototyping
- SQLite type system — dynamic types. A column declared INTEGER can hold strings. Postgres / MySQL enforce types strictly. Quirky for learning but rarely a problem for prototyping.
- JSON support — SQLite's json1 extension covers most JSON access. Postgres jsonb is more powerful (indexes on JSON paths, jsonb operators); some Postgres-specific queries do not translate.
- Window functions — full SQL:2003 support in SQLite. Same syntax as Postgres.
- Common Table Expressions — supported including recursive. Same syntax.
- FULL OUTER JOIN — Postgres yes, MySQL no, SQLite added in 3.39 (2022).
- LATERAL joins — Postgres yes; SQLite no (workaround via CROSS APPLY-style subqueries).
- Row-level concurrency — SQLite uses a global lock for writes; one writer at a time. Reads are concurrent. For prototyping, fine; for production write-heavy workloads, choose differently.
When to reach for this tool
- You have a CSV / JSON file and want to query it with SQL instead of writing pandas / Excel formulas.
- You are learning SQL and want a place to run queries on real data without setting up a database.
- You are designing a schema and want to test CREATE TABLE statements with sample data before applying to production.
- You inherited a CSV export from a colleague and want to do ad-hoc analysis — joins, aggregates, filters — without importing to a heavyweight tool.
What this tool will not do
- It will not run Postgres-specific features. ARRAY types, custom range types, hstore, listen/notify, table inheritance — Postgres-only. Translate to portable SQL or use a real Postgres.
- It will not run stored procedures. SQLite has no PL/pgSQL or T-SQL. For procedural logic, use triggers (limited) or do it in your application code.
- It will not connect to your real database. The browser cannot directly connect to TCP MySQL / Postgres. For that, you need a backend proxy or a desktop SQL client (DBeaver, TablePlus, psql).
- It will not scale to enterprise data. Hundreds of millions of rows or aggregations over them exceed browser memory. Use the playground for prototyping; deploy to a real database for production-scale work.
All SQL execution happens in your browser. CSV files imported and queries run never leave your device. Useful for sensitive data (customer exports, financial datasets) that should not be uploaded.
Frequently asked questions
How big a dataset can I run in the browser?
Practically: 1-10 million rows for interactive queries, 50M+ for batch operations. Browser memory caps around 2GB for most browsers (4GB on 64-bit Chrome with flags). For larger datasets, downsample, partition, or use DuckDB-WASM (more memory-efficient column store).
Can I save my SQL queries between sessions?
The playground saves queries and table contents in IndexedDB if you enable persistence. Clear browser data wipes it. For long-term storage, export the SQLite database file and re-import next session.
Does this support transactions?
Yes — full SQLite transaction support. BEGIN, COMMIT, ROLLBACK work. Useful for "try a destructive operation, see the result, undo" patterns.
Can I import a Postgres dump?
Plain SQL dumps mostly. pg_dump --schema-only --no-owner --no-privileges produces SQL that's ~95% SQLite-compatible. pg_dump --format=custom produces a binary dump SQLite cannot read. For Postgres-specific features, expect manual edits during import.
How is this different from BigQuery or Snowflake?
Different class of tool. BigQuery / Snowflake are massive distributed analytics engines for terabyte-petabyte data. SQLite-in-browser is a lightweight engine for millions of rows. Use the right tool for the data size; do not try to do Pet-scale analytics in the browser.
Can I JOIN data from two different CSV files?
Yes — import each as a separate table, then JOIN normally. The playground treats each CSV import as a CREATE TABLE statement; subsequent queries can join across tables.
Related tools
Format and beautify SQL queries with syntax highlighting. Support for MySQL, PostgreSQL, SQL Server. Free online SQL formatter and pretty printer
Visual ERD designer for database schemas. Create tables, define relationships, foreign keys. Export to SQL for MySQL, PostgreSQL, SQLite. Free online ERD tool
Convert data between JSON, CSV, YAML, XML, TOML formats online. Free data format transformer with syntax validation and pretty printing
Compare two JSON documents with visual tree diff. Highlight added, removed, modified nodes. Expandable tree view. Free online JSON comparison tool
Advanced spreadsheet-like table editor. Sort, filter, search data. Basic formulas support. Import/export CSV, JSON. Free online data grid editor
Last updated · E-Utils editorial team