SQL Playground (In-Browser SQLite)
This is a full SQLite database compiled to WebAssembly and running inside your browser tab. A sample dataset of an employees table joined to a departments table is preloaded, so you can write SELECTs, joins and aggregates the moment it finishes loading. You can also drop in your own .sqlite or .db file, run queries against it, and export the result. No server, no login, and nothing leaves your device.
How to run SQL in the browser
- Wait for the SQLite engine to load, then start from the preloaded employees and departments sample.
- Type a query in the SQL editor and press Run, or use Cmd/Ctrl+Enter.
- Read the results grid below, which shows the row count and NULLs in italics.
- Click a name under Tables to browse its first 100 rows, or an Example queries link to load a starter.
- Drop a .sqlite or .db file into Load your own database to query it instead.
- Use Download database to save the current state, including any changes you made.
Examples
Top 3 earners
SELECT name, title, salary FROM employees ORDER BY salary DESC LIMIT 3;
Grace Hopper, Engineering Lead, 178000; Ada Lovelace, Staff Engineer, 165000; Jony Ive, Design Lead, 159000
Average salary by department
SELECT d.name, COUNT(*) AS headcount, ROUND(AVG(e.salary)) AS avg_salary FROM employees e JOIN departments d ON d.id = e.department_id GROUP BY d.name ORDER BY avg_salary DESC;
Engineering 4 155750, Design 2 141500, Sales 2 107000, Support 2 90000
Count the rows
SELECT COUNT(*) FROM employees;
10
Frequently asked questions
Is my data uploaded anywhere?
No. The database runs entirely in your browser using SQLite compiled to WebAssembly. Your queries and any file you open are processed locally and never leave your device.
What SQL does it support?
It is real SQLite, so standard SELECT, INSERT, UPDATE, DELETE, JOIN, GROUP BY, ORDER BY, window functions, common table expressions, views, triggers and PRAGMA all work, matching whatever the bundled SQLite version supports.
What is in the sample database?
Two related tables. A departments table with Engineering, Design, Sales and Support, and an employees table of ten people whose department_id references departments. It is designed to demonstrate joins, grouping and aggregate functions right away.
Can I run more than one statement at once?
Yes. You can run a whole script separated by semicolons, such as a CREATE TABLE followed by INSERTs and a SELECT. Each statement that returns rows renders as its own results table beneath the editor.
Can I load my own database?
Yes. Drop a .sqlite, .sqlite3 or .db file into the Load your own database zone. It opens locally in memory, replaces the sample, and you can query it or export it back out.
Do my changes persist after I reload the page?
No. The database lives in memory, so refreshing or closing the tab resets everything to the sample. Use Download database first to save any schema or data changes you want to keep.
Why does the first query take a moment?
The SQLite WebAssembly engine has to download and initialize once on first use, which is the brief loading spinner you see. After it loads, queries execute instantly on your device with no network round trip.
How large a database can it handle?
Because it runs in memory in the browser tab, the practical ceiling is your device's available RAM. Small and medium databases are snappy, but a multi gigabyte file may be slow to open or exceed the tab's memory.
Why did my query return an error instead of rows?
SQLite reports syntax and constraint problems just as a normal database would, and the message appears in a red panel. Check table and column names against the Tables list, and remember identifiers are case sensitive only where you quoted them.
Learn more
- Practice SQL joins and aggregates in the browser
Use the preloaded employees and departments tables to learn joins, GROUP BY and aggregate functions with runnable examples you can edit live.
Related tools
JSON to SQL
Convert JSON to SQL INSERT statements online. Paste an array of objects, set a table name, and get ready-to-run INSERTs. Runs in your browser.
CSV to JSON
Convert CSV to JSON online. Turn spreadsheet rows into clean JSON objects or arrays, with smart number and boolean typing. Free tier plus API.
SQLite Viewer
Open a .sqlite or .db file in your browser and browse its tables, schema and rows. Run read-only SQL queries. Your data never leaves your device.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.