SQLite: "database disk image is malformed"

Last reviewed 2026-09-19

SQLite stores data in fixed-size pages arranged as trees. The error appears when one or more pages, or the header, or the list of tables, is damaged. The rest of the file is often still readable, and many apps (browsers, chat clients, note apps) keep their data in such files.

Messages you might see

  • “database disk image is malformed”
  • “file is not a database / file is encrypted or is not a database”
  • “SQLITE_CORRUPT”

Why it happens

  • The app crashed or the device lost power in the middle of a write.
  • The database was copied without its -wal and -shm companion files while the app was open.
  • A failing disk, card or cloud-sync conflict damaged some pages.

Try this first (free, no tool needed)

  1. Copy the file (and any .db-wal / .db-shm files next to it) somewhere safe before doing anything else.
  2. Run PRAGMA integrity_check; in the sqlite3 shell to see how bad it is.
  3. With sqlite3 3.29 or newer: `sqlite3 broken.db ".recover" | sqlite3 recovered.db` rebuilds a new database from what can be read.
  4. Restore the app's own backup if it makes one.

If that didn't work

These tools run in your browser. Your file is read and repaired on your own device and is never uploaded.

Corrupted SQLite Extractor

Reads the file format directly, so a damaged header or table list does not stop it. It walks every table page by page, skips broken pages and gives a CSV per table plus the CREATE statements, and can rebuild rows from pages no table refers to any more. It exports table rows only, does not include changes still waiting in a -wal file, and cannot read encrypted (SQLCipher) databases.

Open Corrupted SQLite Extractor

Common questions

Will it recover deleted rows?

Rows on pages that were freed or dropped along with a table can often be rebuilt. Deleted rows inside a page that is still in use are not carved.

Is my file uploaded anywhere?

No. The tool runs as a program inside your own browser, so the file is read and repaired on your device and never sent to a server.

Related guides