SQLITE MIME Type – Free, Online, Private
application/vnd.sqlite3 is the type for a SQLite 3 database file. The header is the string SQLite format 3 followed by a null.
What .sqlite is
A SQLite 3 database is a single file. The first 16 bytes are the ASCII string SQLite format 3 and a null byte. A page-size field and a header follow, then pages of tables and indexes. IANA registers application/vnd.sqlite3. .sqlite3 and .db are other extensions you will see. Map the ones you actually serve to this type. The format is not a SQL script. The script that created the database is application/sql if you serve it separately. WAL and SHM sidecar files are not this response. They are part of a live database and you should not download a hot database by copying one file out from under a writer.
IANA registers application/vnd.sqlite3. The media type is application/vnd.sqlite3. Extensions that use it on this page: .sqlite. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.
What sends application/vnd.sqlite3
What sends application/vnd.sqlite3: Send application/vnd.sqlite3 for a consistent snapshot. Take the snapshot with the SQLite backup API or by checkpointing, not by reading the file while a writer has it open, unless you know the journal mode makes that safe. Set a filename. Do not add a charset. Enable ranges if the file is large and a client wants a slice, and know that a slice of a database is not a database. Most clients need the whole file. Do not gzip a multi-gigabyte database in front of the response unless you have the CPU budget. The pages are already a mix of compressible text and binary. The file on disk is still .sqlite. Once the response exists, a client trusts application/vnd.sqlite3, not the filename. If you publish a demo database and a .sql build script, they are two URLs. The script is application/sql. The snapshot is application/vnd.sqlite3. Replacing the database bytes with the script under one path gives clients a text file with a database type, which fails the header check after they have already trusted you.
Content-Type for .sqlite
Send application/vnd.sqlite3 and do not add a charset parameter. The body is binary. A charset tells a text decoder to reinterpret bytes that are not text, which corrupts a download and does not help a browser sniff the format.
Content-TypeContent-Type: application/vnd.sqlite3
nginx, Apache, and Express
These snippets map .sqlite to application/vnd.sqlite3. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .sqlite so a stale mime database in the framework cannot disagree with the type on this page.
nginx# /etc/nginx/mime.types, inside the types { } block
application/vnd.sqlite3 sqlite;
ApacheAddType application/vnd.sqlite3 .sqlite
Expressimport express from "express";
const app = express();
app.use(express.static("public", {
setHeaders(res, filePath) {
if (filePath.endsWith(".sqlite")) {
res.setHeader("Content-Type", "application/vnd.sqlite3");
}
},
}));
Pitfalls for application/vnd.sqlite3
Pitfalls that show up for application/vnd.sqlite3, and not for a neighboring type with a similar extension: Serving a live file from a busy process produces a torn read: the header says SQLite and a page in the middle does not match. Readers report corruption. Snapshot first. Another trap is a file that still has a -wal sibling you did not include. The main file can be missing the latest transactions. Checkpoint, then send the main file. Another is application/x-sqlite3, the unofficial alias, on a client that allow-lists only the registered type. Send application/vnd.sqlite3. Another is a database with tokens in a table placed on a public URL. The type is not access control.
- The header string is SQLite format 3 plus a null. A SQL script does not start with that.
- application/vnd.sqlite3 is the registered type. application/x-sqlite3 is unofficial.
- .db is ambiguous. Only send this type when the header matches.
- A WAL file is not a second database you should serve with this type.
Frequently asked questions
What type is a SQLite 3 file?
application/vnd.sqlite3.
What is the signature?
The 16 bytes of SQLite format 3 followed by a null.
Can I copy the file while it is in use?
Not safely, unless you use the backup API or a mode that allows a consistent read. A torn copy still starts with the right header.
Is a .sql dump this type?
No. A dump script is application/sql. This type is the binary database.