creatorvalet

SQL file viewer

Open a text .sql file and inspect its encoding, dialect, statements, comments and bounded excerpts without loading the whole file into memory.

  • SECURE
  • NO UPLOADS
  • NO SIGNUP
  • BROWSER BASED
  • FREE
  • FOREVER.

Support us with a link or a share

Choose a text .sql file

Its bytes stay in this tab. The worker streams them without building a complete token array.

Drop works too. Binary .db, .sqlite, .bak and .mdf files are different formats.
Receipt #2146waiting

The receipt answers five file questions:

  1. Which byte encoding and BOM arrived?
  2. Which SQL dialect has visible evidence?
  3. How many statements and comments are outside strings?
  4. Does a quote, identifier or comment reach EOF?
  5. What is visible in bounded head, tail and statement excerpts?

An SQL file viewer opens text, not a database

A file ending in .sql is normally a script: readable text containing statements such as CREATE TABLE, INSERT and SELECT. A backup export can contain millions of those statements, but it is still instructions and literal values rather than a running database. Opening the file should not execute any of it.

Binary files such as .db, .sqlite, .bak and .mdf are different. Their pages, indexes and transaction structures need the matching database engine. This viewer refuses to blur that distinction. A SQLite database belongs in the SQLite file viewer; a text SQL script belongs here.

How to open a SQL file without executing it

Choose or drop the original file. The worker first identifies a BOM or a likely UTF-16 layout, validates UTF-8 across the complete stream, and otherwise reports Windows-1252. That byte-level answer is why this page has no paste box: once text has passed through a clipboard, its original encoding marker and invalid byte sequences no longer exist.

The dialect label is evidence, not a guess disguised as certainty. Backtick quoting and executable comments point to MySQL; dollar-quoted strings point to PostgreSQL; square bracket quoting and batch separators point to SQL Server. When the bounded file head has no such clue, the receipt says that no dialect was assumed.

Why a large SQL file needs streaming inspection

A conventional editor reads every byte into one large string and often creates another object for every token. That memory multiplier matters more than the file size shown on disk. This viewer instead carries a small lexical state across byte chunks: whether it is inside a string, quoted identifier, line comment, block comment or PostgreSQL dollar-quoted body. Semicolons inside those regions are content, not statement endings.

Only bounded evidence is retained: the file head, a short tail and a few initial statement excerpts. The receipt exposes the maximum raw buffer used by the inspector so “streaming” is a checked property rather than decorative copy. A size notice can explain that a very large file takes time, but size alone never causes rejection.

Viewing, formatting and extracting are different jobs

This page never changes a keyword, removes a comment, connects to a server or evaluates an expression. If the goal is readable indentation or compact output, use the SQL query formatter. If the file is a compatible dump and the goal is rows, the SQL to CSV converter and SQL to JSON converter parse that narrower structure and produce new files.

Keeping those outcomes separate is a safety property. A viewer can report an unterminated quote with its line and column while leaving every source byte untouched. A formatter must serialize new SQL, a converter must interpret tables and values, and an online compiler must execute code against a database. None of those stronger actions is implied merely because you wanted to see what a file contains.

Questions

What is inside a .sql file?

A .sql file is usually plain text containing SQL statements, comments and sometimes an entire database dump. It is not the database engine and does not become rows merely by being opened. This viewer reads the text structure without executing any statement.

Can this open a large SQL file?

Yes. The worker reads a byte stream and keeps bounded head, tail and statement excerpts instead of building one string or token object for every part of the file. The receipt reports the largest internal raw buffer used during this run. File size can trigger practical time advice but never a rejection by itself.

Does it run the SQL or connect to a database?

No. Running a script requires a specific database engine, schema, permissions and transaction policy. This page has no connection field, database runtime or execute action. It counts syntax boundaries and shows excerpts from the original file only.

Why is there no paste box?

Pasting has already converted bytes into browser text, so the original BOM and encoding are gone. Those are core answers for a file viewer. Paste a query into the separate SQL query formatter when the job is editing or reformatting text rather than inspecting a file.

Can it open .db, .sqlite, .bak or .mdf files?

No. Those are binary database or backup formats, not text SQL scripts. Renaming one to .sql does not change its bytes. Use the SQLite file viewer for a SQLite .db file; vendor backup formats require their matching database system.

Is the SQL file uploaded?

No. The selected File is streamed directly to a local web worker. The page has no upload, database connection, execution or remote parsing step, and the bounded excerpts disappear when the tab is closed or another file is opened.