Firefox tabs are stored in the browser's profile folder within files named sessionstore.jsonlz4 and recovery.jsonlz4. The exact location of this folder depends on your operating system, as Firefox creates a unique profile directory for every user.
Firefox Profile Folder Locations
To find where your tabs are stored, you must first locate your profile folder. This directory contains all your bookmarks, passwords, and the session files that track which tabs are open.
On Windows, the profile folder is typically located in %AppData%\Mozilla\Firefox\Profiles\. You can reach this by typing that path into the File Explorer address bar. Inside this folder, you will see a directory with a name like xxxxxxxx.default-release.
On macOS, the path is usually ~/Library/Application Support/Firefox/Profiles/. You may need to hold the Option key in the Finder "Go" menu to see the Library folder.
On Linux, the data is generally stored in ~/.mozilla/firefox/. Because this folder starts with a dot, it is hidden by default; you must enable "Show Hidden Files" in your file manager to see it.
Labels and folder names may differ slightly depending on the version of the browser you are using, but the Profiles directory always contains the session data.
Session Store File Details
The browser does not store tabs as a simple list of URLs in a text file. Instead, it uses a compressed JSON format to save the state of every window, the scroll position of each page, and the history of the tab.
The primary file is sessionstore.jsonlz4. This file is updated constantly while the browser is running. When you close Firefox normally, the current session is written to this file so that your tabs reappear when you restart.
The recovery.jsonlz4 file acts as a temporary backup. It is updated every few seconds to ensure that if the browser crashes or the computer loses power, you can restore your tabs via the "Restore Session" prompt.
Because these files use .jsonlz4 compression, you cannot open them with a standard text editor like Notepad or TextEdit. If you try, you will see a string of unintelligible characters. To read the contents, you must use a specialized decompression tool or a session store recovery utility.
Recovering Lost Tabs
If Firefox closes unexpectedly and your tabs do not reappear, you can often recover them by manipulating the files in the profile folder. This process requires you to close Firefox completely before moving any files.
If your current sessionstore.jsonlz4 is corrupted or empty, check the sessionstore-backups folder located inside your profile directory. Firefox maintains several backup folders here, such as recovery.belt or previous.
To attempt a recovery, follow these steps:
- Close Firefox entirely.
- Navigate to your profile folder.
- Locate the
sessionstore-backupsfolder. - Find the most recent backup file based on the date modified.
- Copy that file and move it back to the main profile folder.
- Rename the copied file to
sessionstore.jsonlz4, replacing the existing one. - Restart Firefox.
If you have multiple windows open, Firefox stores them as an array within the same file. Recovering one file restores all windows and tabs that were active at the time that specific backup was created.
Common Session Misconceptions
A common misconception is that deleting your browser cache or clearing your history will delete your stored tabs. This is incorrect. The cache and history are stored in separate database files, such as places.sqlite. Clearing your history removes the record of where you have been, but it does not close your currently open tabs or delete the session store file.
Another misunderstanding is that "Private Browsing" tabs are stored in the profile folder. Private windows are held entirely in the system's RAM (Random Access Memory). They are never written to the disk in the sessionstore.jsonlz4 file. Once a private window is closed, the data is wiped from memory and cannot be recovered from the profile folder.
Session Data Example
To understand how the browser handles these files, consider a user with 15 tabs open across 2 separate windows. Window A has 10 tabs and Window B has 5 tabs.
When the user clicks "Save" or closes the browser, Firefox does not create 15 separate files. It creates one sessionstore.jsonlz4 file. Inside this file, the data is structured as a nested list: the top level defines the two windows, and each window contains a list of its respective URLs and their current states.
If the user experiences a crash 10 minutes after opening the 15th tab, Firefox looks at the recovery.jsonlz4 file. Since that file is updated every few seconds, it will likely contain all 15 tabs, allowing the user to restore the session exactly as it was seconds before the crash.
Managing Profiles and Sync
If you move your Firefox installation to a new computer, copying the Profiles folder is the most direct way to move your tabs. By copying the entire directory, you preserve the sessionstore.jsonlz4 file and all associated settings.
Alternatively, you can use the built-in Sync feature. Sync does not copy the sessionstore.jsonlz4 file directly from one disk to another. Instead, it uploads the list of open tabs to a secure server. When you log into another device, the browser downloads these URLs and opens them as new tabs.
To manage your tabs via Sync, go to Settings > Sync. Ensure that "Open tabs" is checked in the list of synced items. This allows you to access tabs from a mobile device or a different laptop without needing to manually move files from the AppData or Library folders.
If you find that your tabs are not saving between sessions, check your settings. Go to Settings > General and ensure that "Open previous windows and tabs" is enabled. If this is unchecked, Firefox will ignore the sessionstore.jsonlz4 file upon startup and open a fresh home page instead.
Profile Data for Advanced Users
For those who need to extract URLs from a session file without opening the browser, you can use a JSON converter. Since the file is LZ4 compressed, you first need a tool that can strip the compression header and decode the LZ4 stream into a standard JSON text file.
Once converted to JSON, the file reveals a "windows" object. Each window contains a "tabs" array. Each tab entry includes the url, the title of the page, and the index (the position of the tab in the strip). This allows you to manually copy a list of 50 or 100 URLs from a crashed profile even if the browser refuses to launch.
Be cautious when editing these files manually. A single missing comma or bracket in the JSON structure will make the file unreadable to Firefox, which will result in the browser ignoring the session and starting with a blank slate.