Skip to content

SQL playground. A real database in your browser.

Heads up: the first time you run a query, your browser downloads a one-time SQLite engine (~1 MB). After that it runs fully on your device, even offline, your data and queries are never sent to a server.

Ctrl/⌘ + Enter to run
Examples

A real database that never leaves your laptop

This is a full SQLite engine (sql.js, compiled to WebAssembly) running inside the page, the same SQL you'd write against a production database. Prototype a query, learn JOINs and aggregates, or load a CSV export and slice it with SQL. Everything stays in memory on your device: no account, no upload, no row limits, and it keeps working offline once the engine is cached.

§ · written guide

How to use the SQL Playground

This playground runs a real SQLite database inside your browser using sql.js, SQLite compiled to WebAssembly. It starts with a sample database of customers, orders and employees, and you can import your own CSV file as a new table. Use it to learn SQL, test a query before running it on a real database, or slice a spreadsheet export with SQL.

Step by step

  1. Run your first query

    The editor starts with SELECT * FROM customers;. Press Run query, or Ctrl + Enter (Cmd + Enter on a Mac). The first run downloads the SQLite engine once, which shows a progress bar, then loads the sample data and runs the query.

  2. Try the examples

    Under Examples, press a chip such as All customers, Top 5 orders by amount or JOIN: customer + total spent. Each one loads a ready query into the editor and runs it straight away, so you can read it and change it.

  3. Write your own SQL

    Type in the SQL query box. You can run several statements at once by ending each with a semicolon, and every statement that returns rows gets its own result table. The Tab key inserts two spaces instead of leaving the box.

  4. Browse the tables

    After the first run, the Tables list shows each table with its row count. Open a table to see its columns, their types and the PK mark on the primary key. Hover over a table name to show query, which runs SELECT * on it, and drop, which deletes it.

  5. Import your own CSV

    Press + CSV and pick a .csv, .tsv or .txt file up to 25 MB. In the dialog, check the Table name, leave First row is the column header ticked if the file has headers, look over the preview of the first rows, then press Create table.

  6. Save results or start over

    Above each result table, press Copy CSV to put that result on your clipboard, or Download CSV to save it as query-result.csv. Press Reset DB to throw away your changes and imported tables and restore the original sample data.

Reading the result

  • Each result shows its size first, such as 8 rows · 5 columns for All customers. Number columns are aligned right, and a NULL value shows as NULL in gray italics.
  • The JOIN: customer + total spent example returns all 8 customers. Ada Lovelace comes first with 2 orders and 448 spent, while Linus Torvalds and Guido van Rossum show 0 orders and NULL because they have no orders.
  • Statements that change data or tables instead of returning rows, such as INSERT, UPDATE or CREATE TABLE, show a short confirmation such as 3 rows affected or Statement executed successfully.
  • Errors appear in red after SQL error:, with SQLite's own message, such as a missing table or a typo near a keyword.
  • Only the first 2,000 rows are drawn on screen. When a result has more, a note says so, and Copy CSV and Download CSV still include every row.

Tips and common mistakes

  • This is SQLite, so some syntax from PostgreSQL, MySQL or SQL Server will not run. Dates are stored as text, which is why the sample uses values like 2023-04-01 that sort correctly.
  • Importing a CSV with the same Table name as an existing table drops the old table and replaces it without asking. drop in the Tables list also deletes at once. Reset DB brings back the sample tables, but not a CSV table you imported.
  • On import, each column becomes INTEGER, REAL or TEXT from its values. A column with any value that has a leading zero or a thousands separator becomes TEXT, so ZIP codes keep their zeros.
  • Column names are cleaned on import: spaces and symbols become underscores and a name starting with a digit gets a leading underscore. Check the Tables list for the exact names before you query.
  • Everything lives in memory. Reloading or closing the tab resets the database, so download any results you want to keep.

Privacy and limits

Your queries, the database and any imported file stay in your browser's memory and are never uploaded. The only network request comes the first time the engine is needed (your first run, Reset DB or import), when the sql.js files, about 1 MB, download from the cdn.jsdelivr.net CDN. No query or data goes with them. If you are offline before that first download, the engine cannot load. Imported files are limited to 25 MB.

Back to the tool

§ 02 · what you can do

Everything a query tool should do.

Run real SQLA full SQLite engine, SELECT, JOIN, GROUP BY, CREATE, INSERT, UPDATE, DELETE, running entirely in your browser.
Sample databaseCustomers, orders and employees tables are ready to query the moment the engine loads.
Import a CSV or TSVDrop in your own file as a new table with automatic type inference, then query it instantly with SQL.
Export resultsCopy any result set to your clipboard or download it as a CSV file in one click.
Multi-statement scriptsSeparate statements with semicolons, each result set renders in its own table below.
Private & offlineAfter the one-time engine download, everything works offline with no account and no row limits.
§ 04 · faq

Frequently asked questions.

Is the SQL Playground free?
Yes, completely free for everyone. No sign-up, no account and no usage limits.
Is it private? Is my data uploaded anywhere?
No upload, ever. The SQLite engine runs entirely in your browser on your own device, your queries, your imported CSVs and their data never leave your computer and nothing is sent to a server.
Does it work offline?
Yes, after the one-time SQLite engine download (about 1 MB), the tool keeps working offline. The engine can't download on your very first visit if you're already offline, so run one query while connected and it's cached from then on.
Which SQL dialect does it support?
Full SQLite, the same engine that ships in phones, browsers and countless apps. That means SELECT with JOINs, aggregates, window functions, CTEs, subqueries, plus DDL and DML (CREATE / INSERT / UPDATE / DELETE / ALTER). It's a superb sandbox for learning and prototyping, though vendor-specific syntax from Postgres, MySQL or SQL Server won't run here.
Will my imported tables persist after I close the tab?
No, the database lives in memory only, so closing or reloading the tab resets it to the original sample data. That's by design for a scratch playground. To keep your results, use Download CSV on any query, and keep your source CSV files to re-import next time.
How big a CSV can I import?
Up to 25 MB per file. The importer auto-detects the delimiter (comma, tab, semicolon or pipe), infers each column's type (INTEGER, REAL or TEXT), and bulk-inserts inside a transaction. Result tables render the first 2,000 rows for speed, but Copy CSV and Download CSV always include every row.

Published · Last updated .

Priya sent you a message Online now

Talk to a Developer Now

Share your name and email to reply.

Reply