SQL File Viewer

Open any .sql file or database dump online - MySQL, PostgreSQL, SQLite and SQL Server scripts get syntax highlighting, a table outline and a spreadsheet view of every INSERT. Need the rows somewhere else? Export a table for the CSV Viewer or the Excel Viewer.

or paste SQL
Ctrl + Enter to view · Ctrl + V anywhere
Try a sample
MySQL, PostgreSQL, SQLite, SQL Server 500 MB+ dumps Rows in a grid No upload

How to open and view a SQL file online

  1. Open your SQL file. Drop a .sql or .sql.gz file anywhere on the page, browse for it, paste a few statements, or try a sample dump.
  2. Read the code. The Code tab shows the script with syntax highlighting and line numbers. Search with text or regex, jump to a line, or beautify the whole file.
  3. Explore the structure. The Structure tab lists every table with its columns, types, keys, indexes, foreign keys and row count, plus views, triggers and routines.
  4. View and export the data. The Data tab turns INSERT and COPY rows into a sortable grid. Export a table as CSV, JSON, Excel or SQL, or run SQLite queries in the Query tab.

Keyboard shortcuts

  • Find in fileCtrl + F
  • Next / previous matchEnter / Shift + Enter
  • Go to lineCtrl + G
  • Code / Structure / Data / QueryAlt + 1 2 3 4
  • Run a queryCtrl + Enter
  • Open a fileCtrl + O

What the SQL viewer does for you

Highlighting that knows your dialect

Backslash escapes, versioned comments, dollar quotes, bracket names and GO batches are all read the way your database reads them.

Built for big dumps

A background worker splits hundreds of megabytes into statements in seconds, and only what is on screen is drawn.

Structure at a glance

Columns, types, defaults, primary keys, indexes and foreign keys for every table - even when they are added later with ALTER TABLE.

INSERTs become a grid

Every row of every table in a sortable, searchable spreadsheet view, with row counts per table.

Export what you need

One table as Excel, CSV, JSON or SQL, the whole dump split per table, or the statements as JSON.

Query without a server

Load tables into SQLite in your browser and answer questions with SELECT, JOIN and GROUP BY.

Beautify in one click

Clean, indented SQL with one clause per line - strings and names are never touched.

100% private

Customer tables, password hashes and API keys stay on your device. Nothing is uploaded.

Supported SQL dialects and dumps

The dialect is detected from the first megabyte of the file.

If the guess is wrong, pick the right one under Options - the file is read again in a few seconds.

DialectTypical sourceUnderstood
MySQL / MariaDBmysqldump, phpMyAdmin, Adminer, MySQL Workbench, HeidiSQLBackticks, backslash escapes, /*!40101 ... */ comments, DELIMITER, extended INSERTs, ENGINE and AUTO_INCREMENT
PostgreSQLpg_dump plain format, psql scriptsCOPY ... FROM stdin data, dollar-quoted functions, E'...' strings, schemas, sequences, ALTER TABLE ONLY constraints
SQLitesqlite3 db .dump, DB Browser for SQLiteTriggers with BEGIN ... END bodies, X'..' blobs, AUTOINCREMENT, WITHOUT ROWID
SQL ServerSSMS Generate Scripts, Azure Data StudioUTF-16 files, GO batches, [bracket] names, N'...' strings, CAST values, IDENTITY
OtherOracle, DB2, Snowflake or hand-written scriptsStandard SQL highlighting, statements, search and beautify

How to view a large SQL dump without importing it

Importing a dump just to look at it takes a database server and a lot of waiting.

Opening it here takes seconds, and you can still answer most questions.

  • Check what is inside - the Structure tab lists every table with its row count and data size, so you know if the backup is complete before you restore it.
  • Find one record - search the Data tab of a table, or search the whole file in the Code tab with a regular expression.
  • Pull out one table - export it as SQL to import just that table, or as Excel to share it with someone who does not use SQL.
  • Compressed dumps - .sql.gz files open directly. For a dump inside a ZIP, open it in the ZIP Viewer first.
  • Binary backups - turn them into SQL first: pg_restore -f dump.sql file.dump for PostgreSQL custom dumps, or sqlite3 app.db .dump > dump.sql for SQLite.

JSON columns read better in the JSON Viewer - copy a cell from the grid and paste it there.

About SQL files

A .sql file is plain text with SQL statements that a database can run.

Some are short scripts with a few queries, others are full backups called dumps.

A dump re-creates a database: CREATE TABLE statements describe the tables and INSERT or COPY statements put the rows back. Each database writes them a little differently, which is why the dialect matters.

Which viewer should you use?

  • Use this SQL File Viewer for scripts, schemas and database dumps.
  • Use the CSV Viewer for table exports that are already CSV, or the TSV Viewer for tab-separated ones.
  • Use the Log File Viewer for database server logs such as the MySQL slow query log or PostgreSQL logs.

Browse all file viewers for documents, images and archives.

Frequently Asked Questions

Drop the .sql file onto this page, click to browse, or paste SQL into the box. It opens with syntax highlighting and line numbers, and the Structure and Data tabs show the tables and rows inside it.

It works on Windows, Mac, Linux, Chromebooks and phones with nothing to install.

Yes. The dump is read in slices by a background worker and only the lines and rows on screen are drawn, so a 500 MB dump with millions of rows opens in seconds and scrolls smoothly.

Gzipped .sql.gz files are unpacked in the browser. The limit is 4 GB per file, and your device memory is the real ceiling.

MySQL and MariaDB dumps from mysqldump, phpMyAdmin, Adminer and Workbench, PostgreSQL plain dumps from pg_dump including COPY data and dollar-quoted functions, SQLite .dump output and SQL Server scripts from SSMS Generate Scripts, including UTF-16 files with GO separators.

Any other SQL script opens too, with standard highlighting.

Open the Data tab and pick a table. Every INSERT or COPY row becomes a row in a spreadsheet-style grid that you can scroll, search and sort by any column.

Click a cell to see its full value, and export the table as CSV, JSON or Excel. The CSV opens nicely in the CSV Viewer.

Yes. The Query tab loads the tables you pick into SQLite, which runs inside your browser, so you can run SELECT, JOIN, GROUP BY and window functions on the dump.

Queries use SQLite syntax, and views, triggers and stored procedures are not imported.

No. Your browser reads the file on your own device and nothing is sent to a server, which makes the viewer safe for production dumps with customer data, password hashes and API keys.

Close the tab and the data is gone.

Yes. Beautify rewrites the whole file with one clause per line, indented column lists, one INSERT row per line and uppercase keywords, without changing a single string or identifier.

For very large dumps, select a statement and use Format statement instead, then copy or download the result.

Pick the table in the Structure or Data tab and choose Export, then SQL. You get its CREATE TABLE, indexes and every INSERT or COPY statement copied byte for byte from the dump.

Download, then Split per table, saves every table as its own .sql file in one ZIP.

Guides & Tutorials

All 14 guides
Guide How to Tell What Format an Image File Is (5 Easy Ways) Read the guide Guide How to Open ZIP, RAR, 7Z & TAR.GZ Files Online (Without Installing Anything) Read the guide Comparison PNG vs JPG: Which Image Format Should You Actually Use? Read the guide