- The editor above runs real SQLite in your browser through sql.js. There is no server behind it and no sign-up.
- Two sample databases are built in: a shop (customers, products, orders, order_items) and an HR schema (departments, employees).
- Run with the button or Ctrl+Enter (Cmd+Enter on a Mac), export the last result as CSV, and copy a share link that carries the query in the URL.
- Changes live in memory only: reloading the page or pressing Reset data restores the sample data.
- For PostgreSQL syntax use the PostgreSQL playground; for your own .sqlite files use SQLite online.
How to use this SQL online compiler
- Type a query in the editor, or press one of the Examples buttons to load one.
- Press Run or Ctrl+Enter (Cmd+Enter on a Mac). Each statement that returns rows gets its own result table, and the status line shows how long it took.
- Use Download CSV to save the last result table, and Copy share link to copy a link with your query.
- Pick Sample data to switch between the shop and HR databases, or press Reset data to undo your changes.
The share link stores the query after #q= in the address itself; nothing is saved on our server. Opening the link fills the editor but does not run the query, so the person receiving it presses Run when ready. Result tables show up to 1,000 rows.
The sample databases
Both datasets are small enough to read in full, which helps when you are checking whether a query is right. Open Sample data: tables and columns under the editor to see the live list, including any tables you create.
| Dataset | Table | Columns |
|---|---|---|
| Shop | customers | customer_id, name, email, country, signup_date |
| Shop | products | product_id, name, category, price |
| Shop | orders | order_id, customer_id, order_date, status, total |
| Shop | order_items | order_id, product_id, quantity, unit_price |
| HR | departments | dept_id, name, location |
| HR | employees | emp_id, name, dept_id, manager_id, job_title, salary, hire_date |
Example queries to try
Paste these into the editor. The first two use the shop data; switch Sample data to HR for the third. They are SQLite syntax, which follows standard SQL closely; substr is SQLite's spelling of a substring function.
SELECT name, category, price
FROM products
WHERE price > 30
ORDER BY price DESC;WITH kept AS (
SELECT substr(order_date, 1, 7) AS month, total
FROM orders
WHERE status <> 'returned'
)
SELECT month, COUNT(*) AS orders, SUM(total) AS revenue
FROM kept
GROUP BY month
ORDER BY month;SELECT e.name, e.job_title, m.name AS manager
FROM employees e
LEFT JOIN employees m ON m.emp_id = e.manager_id
ORDER BY e.emp_id;What it can and cannot do
The engine is SQLite compiled to WebAssembly by the sql.js project, which keeps the database in memory. That makes it quick and private, and it also sets the limits:
- Nothing persists. Tables you create disappear when you reload. Keep queries you want in a share link or a file.
- SQLite dialect. Engine-specific syntax such as
TOP,SHOW TABLES,DUALor stored procedures will not run. SQLite also uses dynamic typing, so a column's declared type does not stop other kinds of values being stored. - Not for large data. Everything sits in the browser tab's memory.
For other engines see PostgreSQL online (real Postgres in the browser), the MongoDB playground, and the guides to free ways of running MySQL, SQL Server and Oracle. To tidy a long query, use the SQL formatter.
Privacy: your SQL stays in your browser
The SQLite engine is loaded from this site as a file, then runs entirely on your device. The queries you type and the results they produce are not sent to CodeWithSQL or anywhere else. A share link contains the query text itself, so treat it like the query: anyone you send it to can read it.
To keep learning, work through the SQL exercises (each has a schema, sample data and an expected result you can reproduce here) or start the SQL beginner course.
All playground tools
Run SQL in your browser
- SQLite Online: Open, Edit & Query SQLite Files in Your Browser
- PostgreSQL Online: Run Postgres Queries in Your Browser
- MongoDB Online Playground: Practise Queries in Your Browser
Other databases online
- MySQL Online Compiler: Free Options and a Browser SQL Playground
- SQL Server Online: Free Ways to Run T-SQL
- Oracle SQL Online: Free Ways to Run Oracle SQL & PL/SQL
SQL tools
Frequently asked questions
Is this SQL online editor free?
Yes. There is no account and nothing to install, and the playground sets no limit on the number of queries you run.
Which SQL dialect does it use?
SQLite. Standard SQL such as joins, subqueries, CTEs and window functions works as written. For PostgreSQL-specific syntax use the PostgreSQL playground.
Is it like SQL Fiddle or DB Fiddle?
It serves the same purpose: run a query against a small database and share it. Here the database runs in your own browser, and the share link holds the query in the URL rather than storing it on our side.
Can I create my own tables?
Yes. CREATE TABLE, INSERT, UPDATE and DELETE all work. Your tables last until you reload the page or press Reset data.
Can I open my own database file?
Yes, on the SQLite online page, which can open a .sqlite or .db file from your computer without uploading it.
Sources
- sql.js on GitHub
- sql.js documentation
- SQLite: About SQLite
- SQLite: Window functions
- SQLite: The WITH clause
- SQLite: Datatypes in SQLite
- SQLite: SQL features that SQLite does not implement
- PGlite: What is PGlite
Checked 8 October 2026.
How we research tool pages: our editorial method. The engines are open-source projects credited on each page.