UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

SQL Online Runner

Query CSV and JSON files with SQL in your browser — powered by DuckDB-WASM.

About SQL Online Runner

SQL Online Runner lets you run SQL queries against CSV and JSON files directly in your browser, powered by DuckDB-WASM — a full analytical SQL engine compiled to WebAssembly. Upload one or more files and each is automatically registered as a virtual table named after the filename. Then write any SQL query — SELECT, GROUP BY, JOIN, window functions, aggregates — and see paginated results instantly. Export query output as a CSV file with one click. DuckDB supports a broad ANSI SQL superset plus analytical extensions like window functions, PIVOT, list comprehensions, and STRUCT types. The first use downloads DuckDB-WASM (~10 MB) which is cached by the browser. Your files are processed entirely in memory inside your browser tab and are never uploaded to any server.

Why use SQL Online Runner

  • Full DuckDB SQL engine — window functions, JOINs, aggregates, PIVOT all work
  • No upload — files are processed entirely in your browser tab
  • Supports both CSV (auto-detected schema) and JSON (newline-delimited or array)
  • Multi-file support — upload several files and JOIN between them
  • Paginated results with one-click CSV export
  • Full DuckDB SQL engine — window functions, JOINs, aggregates, PIVOT/UNPIVOT, CTEs all work as in a desktop database

How to use SQL Online Runner

  1. Click the file input and upload a CSV or JSON file.
  2. The file is registered as a virtual table using the filename (without extension) as the table name.
  3. Write a SQL query in the editor referencing the table name.
  4. Click Run Query — DuckDB loads on first use (~10 MB) then executes instantly.
  5. Browse paginated results and click Export CSV to download the output.
  6. Click the file input and upload one or more CSV or JSON files (drag-drop also works).
  7. Each file is registered as a virtual table using the filename (without extension) as the table name — see the table list above the SQL editor.

When to use SQL Online Runner

  • Filtering or aggregating a large CSV without opening Excel or writing a Python script
  • Exploring the shape and contents of a JSON API response saved to a file
  • Joining two CSVs on a common key without a database server
  • Checking data quality (NULLs, duplicates, outliers) with SQL GROUP BY queries
  • Teaching SQL concepts with real data files in an accessible browser environment
  • Joining two CSVs on a common key without spinning up a database server

Examples

Top 5 categories by revenue

Input: SELECT category, SUM(amount) AS revenue FROM sales GROUP BY category ORDER BY revenue DESC LIMIT 5;

Output: category | revenue ---------|-------- electronics | 41250.00 books | 18900.50 apparel | 15240.75 grocery | 9120.25 beauty | 7430.10

JOIN two CSVs on user_id

Input: SELECT u.name, COUNT(o.id) AS orders FROM users u LEFT JOIN orders o ON o.user_id = u.id GROUP BY u.name ORDER BY orders DESC;

Output: name | orders ------|------ Ada | 12 Grace | 9 Bob | 4 Linus | 0

Window function: 7-day moving average

Input: SELECT day, sales, AVG(sales) OVER ( ORDER BY day ROWS BETWEEN 6 PRECEDING AND CURRENT ROW ) AS ma7 FROM daily_sales ORDER BY day;

Output: day | sales | ma7 -----------|-------|------ 2026-01-01 | 100 | 100.0 2026-01-02 | 120 | 110.0 2026-01-03 | 90 | 103.3 ... (continues)

Tips

  • Filenames with spaces or hyphens become table names with underscores — quote them as "my_file" if needed.
  • Use 'DESCRIBE table_name' to inspect inferred column types before writing queries.
  • DuckDB's read_csv_auto handles tricky CSVs (quoted commas, mixed types) automatically — no schema needed.
  • Window functions (ROW_NUMBER, RANK, LAG/LEAD) are first-class — use them for time-series and top-N-per-group queries.
  • For JSON files, use json_extract(col, '$.path') to dig into nested structures within a query.
  • Wrap multi-statement scripts in BEGIN; ... COMMIT; if you need transactional semantics inside the browser session.
  • If memory pressure shows, drop unused tables with DROP TABLE name; the registered virtual tables stay until reload.

Frequently Asked Questions

What SQL dialect does DuckDB use?
DuckDB supports a broad subset of standard SQL plus analytical extensions including window functions, list comprehensions, PIVOT/UNPIVOT, and STRUCT types.
Is my data uploaded to a server?
No. DuckDB runs entirely in your browser as a WebAssembly module. Your files are loaded into browser memory and never transmitted anywhere.
What file formats are supported?
CSV and JSON. For CSV, DuckDB auto-detects delimiters and column types. For JSON, it reads newline-delimited or array-wrapped records.
Is there a file size limit?
Limited only by browser memory. Files up to around 100 MB generally work well; very large files may slow down or exhaust available memory.
Can I query multiple files with a JOIN?
Yes — upload multiple files and each is registered as its own table. Reference them by their respective table names in a JOIN query.
How do I reference the table name in a query?
The table name is the filename without the extension, with non-alphanumeric characters replaced by underscores. The registered table names are shown above the SQL editor after upload.

Explore the category

Glossary

DuckDB
An in-process analytical SQL database (similar in spirit to SQLite but optimized for OLAP workloads), written in C++ and compiled to WebAssembly for browser use.
DuckDB-WASM
The official WebAssembly build of DuckDB that runs entirely in a browser tab via Web Workers, with no native dependencies.
WASM (WebAssembly)
A portable binary instruction format that runs in browsers at near-native speed, used here to execute DuckDB's C++ code client-side.
SQLite
Another popular in-process SQL database; DuckDB targets analytical (OLAP) queries while SQLite targets transactional (OLTP) workloads.
Window function
A SQL construct (ROW_NUMBER, RANK, LAG, LEAD, SUM OVER) that computes results across rows related to the current row without collapsing them via GROUP BY.
CTE (Common Table Expression)
A WITH-clause query that defines a named temporary result set used in a subsequent SELECT, often used to organize complex queries.
PIVOT/UNPIVOT
DuckDB extensions that reshape rows into columns (PIVOT) or columns into rows (UNPIVOT), useful for cross-tab reports.
Virtual table
A table that exists only in DuckDB's session — backed by a CSV or JSON file in this tool — and disappears when the page reloads.
REPL
Read-Eval-Print Loop. This tool acts as a SQL REPL where each Run Query evaluates the current editor contents and renders results below.