DuckDB Viewer: Complete Feature Guide & Reference
🦆 Open the DuckDB Viewer to explore every feature described in this guide.
Open DuckDB Viewer →Contents
What Is the DuckDB Viewer?
The FinancialDataTools.com DuckDB Viewer is a free, browser-based tool for opening, querying, and exporting DuckDB database files. It uses DuckDB-Wasm — the official WebAssembly build of the DuckDB analytical engine — to read your database and execute SQL queries entirely inside your browser. No file is ever transmitted to any server.
Unlike simpler tabular viewers, the DuckDB Viewer gives you a full analytical SQL engine in the browser. You can run window functions, CTEs, JOINs, PIVOT operations, and complex aggregations against your DuckDB data without installing anything.
Try the DuckDB Viewer — runs entirely in your browser and never uploads your files.
Open the DuckDB Viewer →How DuckDB-Wasm Works
DuckDB-Wasm is the official WebAssembly port of the DuckDB columnar analytical database. It compiles the full DuckDB C++ engine to WebAssembly so it can run natively inside a browser tab. When you open a .duckdb file in the viewer:
- The DuckDB-Wasm runtime is initialized in a Web Worker (so it doesn't block the browser's main UI thread)
- Your database file is registered in DuckDB-Wasm's virtual file system using
registerFileBuffer - The database is attached using DuckDB's
ATTACHcommand - All subsequent queries — table listing, row fetching, and your custom SQL — execute entirely within the Wasm runtime in your browser
The viewer selects the optimal DuckDB-Wasm bundle automatically: the eh (exception handling) bundle on browsers that support it, or the mvp bundle as a fallback. This means you always get the best performance available in your browser.
Supported File Formats
| Extension | Description |
|---|---|
| .duckdb | Standard DuckDB database file |
| .db | DuckDB databases saved with the .db extension |
Note: The DuckDB Viewer reads DuckDB-native files. SQLite files (.sqlite, .db3) should be opened in the SQLite Viewer instead. Parquet files can be opened in the Parquet Viewer or queried from within a DuckDB database.
The Toolbar
| Button | Function |
|---|---|
| Open File | Opens a system file picker to select your .duckdb or .db file |
| SQL | Toggles the SQL Query Panel open or closed (amber button) |
| Schema | Opens the column schema modal for the active table |
| Export | Opens the export dialog for the active view |
| File name display | Shows the currently loaded database file name |
| Search box | Global text search across all visible columns |
Table Browser
When a database is loaded, the tab bar below the toolbar shows a tab for each table in the database. Clicking a tab loads that table's rows into the main data grid. The stats bar below the tab bar shows the total row count, visible row count, column count, and the current table name.
Sorting Columns
Click any column header to sort ascending; click again to sort descending; click a third time to return to the original order. Sorting is applied client-side to the currently loaded page of rows. For paginated tables, sorting reorders the rows within the current page only — use the SQL panel with an ORDER BY clause for globally-sorted results across all rows.
Row Filtering
Each column header contains a filter icon. Click it to open the column filter panel, which offers two modes:
- Values mode: A checklist of all distinct values in the column (sampled from the current page). Uncheck values to hide matching rows.
- Conditions mode: Apply up to two conditions with operators: contains, equals, does not equal, begins with, ends with, greater than, less than, is empty/null, and more. Combine two conditions with AND or OR.
Column filters operate on the loaded page of rows. For large paginated tables, the SQL panel provides server-side filtering with full DuckDB SQL expressiveness.
Global Search
The toolbar search box performs a real-time text search across all columns in the current view. It works on the currently loaded rows and stacks with active column filters.
SQL Query Panel
The SQL panel is the most powerful feature of the DuckDB Viewer. Click the amber SQL button in the toolbar to toggle it open. The panel contains:
- A resizable multi-line SQL editor with placeholder examples
- A Run button (or press Ctrl+Enter / Cmd+Enter) to execute the query
- An error display area showing any SQL syntax or runtime errors
- A status line showing the number of rows returned by the last query
Query results replace the current table view in the main grid. The column headers, type badges, sorting, filtering, and export all work identically on SQL query results as they do on raw table data. You can export the results of any query directly to CSV, JSON, TSV, or Excel.
SQL Query Examples
Because the viewer runs a full DuckDB engine, you have access to the complete DuckDB SQL dialect. Some examples relevant to financial data:
Basic SELECT with filter and sort:
SELECT trade_date, symbol, quantity, price, quantity * price AS notional
FROM trades
WHERE trade_date >= '2025-01-01'
ORDER BY trade_date DESC
LIMIT 500;
Window function — running total:
SELECT
trade_date,
amount,
SUM(amount) OVER (ORDER BY trade_date ROWS UNBOUNDED PRECEDING) AS running_total
FROM transactions
ORDER BY trade_date;
Aggregation with GROUP BY:
SELECT
symbol,
COUNT(*) AS num_trades,
SUM(quantity) AS total_shares,
AVG(price) AS avg_price,
MIN(price) AS low,
MAX(price) AS high
FROM trades
GROUP BY symbol
ORDER BY num_trades DESC;
CTE for multi-step analysis:
WITH daily_pnl AS (
SELECT trade_date, SUM(pnl) AS daily_total
FROM positions
GROUP BY trade_date
)
SELECT
trade_date,
daily_total,
AVG(daily_total) OVER (ORDER BY trade_date ROWS 29 PRECEDING) AS ma_30d
FROM daily_pnl
ORDER BY trade_date;
DuckDB supports many additional features: PIVOT, UNPIVOT, ASOF JOIN, list and struct operations, JSON functions, QUALIFY, EXCLUDE columns, and macro definitions.
Schema Inspector
Click the Schema button in the toolbar to open the column schema modal for the active table. This displays each column's name, DuckDB data type, and nullable status, derived from DuckDB's DESCRIBE command. You can copy the full schema as plain text using the Copy Schema button.
Pagination
Tables with more than 50,000 rows are automatically paginated to 5,000 rows per page. DuckDB-Wasm fetches each page directly from the attached database using LIMIT … OFFSET, so only the rows being displayed are loaded into browser memory at any time. This makes the viewer efficient even for large analytical databases.
The page bar at the bottom shows the current page, total pages, and row range. Navigation buttons — First, Previous, Next, Last — allow quick movement between pages.
Export Options
Click Export in the toolbar to open the export dialog. Four formats are available:
| Format | Best For | Notes |
|---|---|---|
| CSV | Python/pandas, data pipelines, spreadsheets | UTF-8; NULL as empty string |
| JSON | APIs, JavaScript, downstream processing | Array of objects; column names as keys |
| Excel (.xlsx) | Sharing with non-technical stakeholders | Frozen header row; auto-sized columns; attribution sheet |
| TSV | Tab-separated import targets | Useful when values may contain commas |
Three export scopes are available:
- Filtered view: Exports only rows visible after applying search and column filters
- Full table: Queries DuckDB for all rows in the active table and exports them, regardless of filters
- All tables (Excel only): Exports every table in the database to a single .xlsx workbook with one worksheet per table
Privacy & Security
The DuckDB Viewer is built privacy-first. Your database file is registered in DuckDB-Wasm's in-memory virtual file system and never transmitted to any server. The entire DuckDB engine — query parsing, execution, and result formatting — runs inside your browser via WebAssembly.
Network requests from the viewer are limited to loading the DuckDB-Wasm runtime from jsDelivr CDN and ExcelJS for Excel export. No query results, table data, or file contents leave your browser.
This makes the viewer appropriate for sensitive analytical databases including:
- Trading strategy backtests and position data
- Financial model outputs stored in DuckDB
- Analytics pipelines that write results to .duckdb files
- Local data warehouses built with DuckDB for financial analysis
Closing the browser tab clears all data from memory immediately.
Use Cases for Financial Data
DuckDB has become a widely used in-process analytical database for financial data work, particularly in Python and R data science workflows. Common scenarios where the viewer adds immediate value:
- Backtesting results: Algorithmic trading frameworks that persist backtest results to DuckDB files can be inspected without opening a Python environment. Run ad-hoc SQL to slice results by strategy, symbol, or date range.
- Local data warehouses: Data engineers who maintain local analytical databases in DuckDB for financial data exploration can use the viewer as a lightweight query interface without spinning up a full IDE.
- Python and R pipeline outputs: Analysts using DuckDB in Python (
import duckdb) or R can inspect database files produced by their pipelines directly, with full SQL access to validate results. - Market data caches: Financial data cached from APIs or data vendors into DuckDB (common in pandas-DuckDB workflows) can be browsed and queried without writing additional code.
- Portfolio analytics: DuckDB's window functions and ASOF JOIN make it particularly suited for time-series portfolio data. Use the SQL panel to run rolling return calculations, drawdown analysis, and attribution without additional tooling.
