A write-ahead log viewer is a tool for inspecting SQLite -wal files so an examiner can review earlier versions of database pages, identify transaction boundaries, and recover records that no longer appear in the live database.
The WAL can hold committed changes that have yet to reach the main database. It can also retain earlier versions of pages while the relevant bytes survive.
In WAL mode, SQLite writes changed pages to the -wal file as frames. A transaction can commit there before a checkpoint copies its pages back to the main database.
WAL mode lets a reader and a writer work concurrently. For examiners, successive frames can preserve several versions of the same page.
To read a committed snapshot, SQLite takes the latest valid WAL frame for each page up to the reader’s commit boundary. If no frame applies, it reads the page from the main database. Frames after the latest valid commit fall outside the latest committed view. See SQLite’s WAL read rules.
It is where you go to answer questions the live database cannot:
A -wal file is a 32 byte header followed by frames. Each frame is a 24 byte header plus one complete page image.
| Offset | Size | Meaning |
|---|---|---|
0 | 4 | Page number |
4 | 4 | Database size in pages, if this frame commits. Otherwise zero. |
8 | 4 | Salt-1, copied from the file header |
12 | 4 | Salt-2, copied from the file header |
16 | 8 | Two running checksums |
On a valid frame, a nonzero value at offset 4 marks the end of a transaction. The value is the database size in pages after the commit. A zero value can appear on an earlier frame in the same committed transaction.
frame 1 00 00 00 04 00 00 00 00 frame 2 00 00 00 07 00 00 00 00 frame 3 00 00 00 02 00 00 00 0C frame 4 00 00 00 04 00 00 00 00 frame 5 00 00 00 09 00 00 00 0C frame 6 00 00 00 04 00 00 00 00 frame 7 00 00 00 07 00 00 00 00 frame 8 00 00 00 03 00 00 00 00 frame 9 00 00 00 02 00 00 00 0C
Frames 1 to 3 are one transaction, because frame 3 commits. Frames 4 and 5 are a second. Frames 6 to 9 are a third. Three transactions, nine frames.
Now look at page 4. It appears in frames 1, 4 and 6. These are three versions of the same page. Frame 6 supplies page 4 after the commit in frame 9. Frames 1 and 4 preserve the earlier versions in this example.
A checkpoint copies frames from the WAL back into the database file. After that the WAL can restart, meaning the next write begins again at frame 1.
The salt values at offsets 8 and 12 exist for integrity. If a reader is working through the file and it restarts underneath, the salts stop matching and the reader knows to stop rather than stitch together pages that never coexisted.
When the WAL restarts, both salts change. Frames further down the file keep the previous pair, because nothing goes back to clear them, and the file is usually not shortened. SQLite stops reading at the first mismatch. Everything past that point is invisible to the engine.
header offset 16 00 00 00 05 salt-1
header offset 20 9A 3F C1 07 salt-2 frame 41 00 00 00 04 00 00 00 00 00 00 00 04 1E 77 B2 D9 Salt-1 is 4, not 5. That frame belongs to the previous generation of this WAL. It is a complete page image from before the last checkpoint, sitting on disk in full, and it is one of the better sources of historical state in the whole format.
The frame checksums are cumulative, each computed over the running value from the frame before. The point where the chain breaks is another way to find where the current generation ends and the leftovers begin.
A row in a WAL page image may be part of the latest committed state, an earlier version, or a copy that matches a row already written to the main database during a checkpoint. To support a deletion finding, identify the table and record key, then compare the row across valid committed database states. Check the whole table in the later state because the row may have moved to another page.
In our Firefly test using NIST CFTT data, Firefly reported all 100 updated row IDs with their stored values and WAL offsets. Those values were already in the main database, and the captured WAL held no pre-update values for those rows. We marked the separate check for modified-row status as Not Applicable.
Because there is no timestamp anywhere in the format. Not in the file header, not in any frame header. Any time you have dated something out of a WAL, that came from a value inside a page rather than from the log itself.
Frame order is the order SQLite flushed pages, which is related to the order of events and is not the same thing. Sending one message can write the table leaf, an index page, sqlite_sequence and a freelist page. Four frames, one action. Meanwhile a background task the user never triggered writes frames in between.
Present frame order to a court as the order of events and you are presenting the order in which pages happened to be flushed. What the file gives you reliably is states, not moments.
A sequence of states. Page 4 looked like this, then like this, then like this. What happened between them, and when, has to come from inside the pages.
That a page held certain content at some point before it held its current content.
When that happened, or that adjacent frames belong to the same user action.
By never opening the original with a read-write connection.
A standard SQLite connection can checkpoint the WAL when it closes, merging its contents into the database file, and depending on journal mode it can delete the -wal and -shm files entirely. Everything described on this page can disappear in the moment a handle closes, including from a tool that only intended to look.
Copy the database, the -wal and the -shm together, and work on the copy. If you must touch the original, open it read only.
Nothing warns you when it goes wrong. The file is simply smaller than it was, and the frames you needed are gone. It is worth building the habit before you need it.
The -shm file is the index SQLite builds so readers can find the newest frame for a page without scanning the whole file. It is derived rather than primary and is rebuilt when needed, so treat it as a signal about state rather than as evidence in itself.
See each version of a page in write order, not only the current state.
Group frames by commit, so you know which writes belonged together.
Reach the page images from earlier generations that SQLite itself will not read.
Interpret a recovered page against the schema rather than as loose bytes.
Move from a recovered record to the offset it came from without leaving the case.
Open the evidence without the risk of checkpointing it on close.
Most database browsers were not built for this. They open the database, silently merge the WAL, and show you the result. That is correct behaviour for a developer tool and the wrong behaviour for evidence.
A forensic WAL viewer has to do the opposite: leave the source untouched, expose the frames rather than the merged result, and keep each recovered record connected to the frame and offset it came from.
Firefly treats WAL analysis as part of the case rather than as a separate artifact. Records recovered from WAL frames appear alongside live records and alongside records from rollback journals, freelist pages and freeblocks, each labelled with the mechanism that surfaced it.
Available fields depend on which bytes survived. A freelist page or freeblock may preserve only part of a record. An earlier WAL frame can show a previous page state. Use that source context and other evidence to assess whether a row was updated or deleted.
Evidence handling is read-only throughout, with SHA-256 evidence-set validation, and everything runs locally. Where the data supports it, a finding keeps its source location and that context carries into an interactive report.
Firefly is not an extraction tool. It starts where decoded output stops and assumes you keep the platform you already use. SQLite Visualizer is now part of Firefly.
The broader framework is on SQLite Forensic Analysis. On validating what a viewer shows you, see When a Viewer Is Not Enough.
Everything on this page is format knowledge rather than tool knowledge. It transfers to whatever platform is on your desk, and it is taught in two places depending on how much of it you want.
The write-ahead log on its own, taught at the level this page describes. Built for examiners who need pre-checkpoint recovery now rather than a full course.
The whole format, with WAL and SHM as one part of it. Guided and self-paced, with real training databases you download and work on in your own tools.
No coding required. Written for investigators rather than developers. 90 days of access, course related email support and a one hour instructor session.
Certified SQLite Forensics also runs live online and on-site by arrangement. See the formats.
Last updated 30 November 2026
Continue through related SQLite investigation workflows and connect this topic back to the main forensic tool.