How to Export Firefox Bookmarks: A Complete Technical Guide
Exporting Firefox bookmarks creates a portable HTML file containing every saved URL, folder structure, and metadata from your browser profile. This file is universally compatible with all major browsers — Chrome, Edge, Safari, Brave — and serves as a reliable offline backup independent of any sync service.
The export process takes under two minutes: open the Firefox Library (Ctrl+Shift+O), click Import and Backup, select Export Bookmarks to HTML, choose a save location, and click Save. The resulting .html file is human-readable, fully portable, and requires no Firefox installation to open or import elsewhere.
Why Exporting Bookmarks Matters More Than You Think
Most users treat bookmarks as ephemeral browser data, but in practice they represent years of curated research, project references, client links, and workflow shortcuts. Relying exclusively on Firefox Sync introduces a single point of failure: if your Firefox Account is compromised, accidentally signed out, or the sync service experiences an outage, your entire bookmark library can become inaccessible.
A locally exported HTML file eliminates that dependency. It also enables:
- Cross-browser migration without manual re-entry of URLs
- Team or client handoffs where a shared bookmark set needs distributing
- Archival snapshots before major browser profile changes or OS reinstalls
- Server-side bookmark access when managing a remote environment via VPS Hosting and running a headless browser or automation script that needs a seed URL list
- Compliance and audit trails in regulated environments where browsed resources must be documented
Understanding the Firefox Bookmark Data Structure
Before walking through the export steps, it helps to understand what Firefox actually stores and how the HTML export represents it.
Firefox stores bookmarks internally in a SQLite database located at:
- Windows:
%APPDATA%MozillaFirefoxProfiles<profile-id>places.sqlite - macOS:
~/Library/Application Support/Firefox/Profiles/<profile-id>/places.sqlite - Linux:
~/.mozilla/firefox/<profile-id>/places.sqlite
The places.sqlite database contains the moz_bookmarks and moz_places tables. When you export to HTML, Firefox reads these tables and generates a Netscape Bookmark File Format document — the same format originally introduced by Netscape Navigator and now the de facto standard for bookmark interchange across all browsers.
The exported HTML file preserves:
- Folder hierarchy as nested
<DL>and<DT>elements - ADD_DATE and LAST_MODIFIED Unix timestamps for each entry
- ICON attributes containing Base64-encoded favicons (this can make large bookmark exports significantly bigger in file size)
- Tags stored as a special flat folder named "Tags"
- The Bookmarks Toolbar, Bookmarks Menu, and Other Bookmarks as top-level containers
One critical nuance: the HTML export does not include bookmark keyword shortcuts (the single-word aliases you can assign to bookmarks for address-bar quick-launch). Those are stored separately in places.sqlite and are lost during a standard HTML export. If keyword shortcuts matter to your workflow, back up places.sqlite directly.
Step-by-Step: Exporting Firefox Bookmarks via the GUI
Step 1: Open the Firefox Library
Launch Firefox. Access the Library using either method:
- Click the hamburger menu (three horizontal lines) in the top-right corner, then select Bookmarks, then Manage Bookmarks
- Use the keyboard shortcut
Ctrl+Shift+Oon Windows/Linux orCmd+Shift+Oon macOS
The Library window opens as a separate panel displaying your full bookmark tree.
Step 2: Access the Import and Backup Menu
Inside the Library window, locate the toolbar at the top. Click the Import and Backup button. A dropdown appears with the following options:
- Backup (saves a
.jsonlz4compressed JSON file — Firefox-specific format) - Restore (from a previous
.jsonlz4backup) - Import Bookmarks from HTML
- Export Bookmarks to HTML
- Import Data from Another Browser
Select Export Bookmarks to HTML.
Step 3: Choose a Save Location and Export
A standard OS file dialog opens. Navigate to your preferred save location. Recommended locations depending on use case:
- Local backup:
Documents/Bookmarks-Backups/ - Cross-device transfer: a USB drive or cloud-synced folder
- Server environments: a shared network path or mounted volume
Name the file descriptively, for example firefox_bookmarks_2025-07-15.html, then click Save.
Firefox writes the file immediately. There is no progress bar for typical bookmark sets — the operation completes in milliseconds for libraries under a few thousand entries.
Step 4: Verify the Exported File
Do not skip verification. Open the exported HTML file in any text editor or browser tab to confirm it contains your data. In a terminal:
# Check file size and line count as a quick sanity check
wc -l firefox_bookmarks_2025-07-15.html
grep -c "<A HREF" firefox_bookmarks_2025-07-15.htmlThe second command returns the total number of individual bookmark entries. If the count looks dramatically lower than expected, re-export — Firefox occasionally silently fails the write operation if the target directory has permission issues.
Step-by-Step: Exporting Firefox Bookmarks via the Command Line
For users managing Firefox on a remote server, running automated backups, or scripting profile migrations, the GUI approach is impractical. Firefox does not expose a native CLI export flag, but you can extract bookmarks directly from places.sqlite using SQLite tooling.
Prerequisites
Ensure sqlite3 is installed:
# Debian/Ubuntu
sudo apt install sqlite3
# RHEL/CentOS/AlmaLinux
sudo dnf install sqliteExport All Bookmark URLs from places.sqlite
# Set your Firefox profile path
PROFILE_DIR="$HOME/.mozilla/firefox/$(ls ~/.mozilla/firefox/ | grep '.default-release')"
# Export all bookmark URLs to a plain text file
sqlite3 "$PROFILE_DIR/places.sqlite"
"SELECT moz_places.url FROM moz_bookmarks
JOIN moz_places ON moz_bookmarks.fk = moz_places.id
WHERE moz_bookmarks.type = 1;"
> bookmarks_export.txtImportant: Firefox must be fully closed before running this query. SQLite will return a "database is locked" error if Firefox holds an active write lock on places.sqlite. On Linux systems, you can verify this with:
lsof | grep places.sqliteGenerate a Full HTML Export Programmatically
For a complete HTML export matching Firefox's native format, use Python with the sqlite3 standard library module:
import sqlite3
import os
import time
profile_path = os.path.expanduser(
"~/.mozilla/firefox/<your-profile-id>/places.sqlite"
)
conn = sqlite3.connect(f"file:{profile_path}?mode=ro", uri=True)
cursor = conn.cursor()
cursor.execute("""
SELECT mp.url, mb.title, mb.dateAdded
FROM moz_bookmarks mb
JOIN moz_places mp ON mb.fk = mp.id
WHERE mb.type = 1 AND mb.title IS NOT NULL
ORDER BY mb.dateAdded DESC
""")
rows = cursor.fetchall()
conn.close()
with open("bookmarks_export.html", "w", encoding="utf-8") as f:
f.write("<!DOCTYPE NETSCAPE-Bookmark-file-1>n")
f.write("<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">n")
f.write("<TITLE>Bookmarks</TITLE>n<H1>Bookmarks</H1>n<DL><p>n")
for url, title, date_added in rows:
ts = date_added // 1000000 # Convert microseconds to Unix timestamp
f.write(f' <DT><A HREF="{url}" ADD_DATE="{ts}">{title}</A>n')
f.write("</DL><p>n")
print(f"Exported {len(rows)} bookmarks.")This approach is particularly useful when automating bookmark archival on a Dedicated Server running scheduled browser automation tasks.
Importing the Exported HTML File into Other Browsers
Google Chrome and Chromium
- Open Chrome and navigate to
chrome://bookmarks/ - Click the three-dot menu in the top-right of the Bookmarks Manager
- Select Import bookmarks
- Choose your exported
.htmlfile
Chrome imports the entire folder structure and places it under a folder labeled "Imported" in the Bookmarks Bar.
Microsoft Edge
- Open Edge and go to
edge://favorites/ - Click the three-dot menu, then Import favorites
- Select Favorites or bookmarks HTML file
- Browse to your exported file and click Import
Safari (macOS)
- Open Safari
- Go to File > Import From > Bookmarks HTML File
- Select the exported
.htmlfile
Brave Browser
- Open Brave and navigate to
brave://bookmarks/ - Click the three-dot menu, select Import bookmarks
- Choose the HTML file
Firefox Backup Formats Compared: HTML vs. JSON
Firefox offers two native export formats. Understanding the difference is essential for choosing the right backup strategy.
| Feature | HTML Export (`.html`) | JSON Backup (`.jsonlz4`) |
|---|---|---|
| Format | Netscape Bookmark File (HTML) | Compressed JSON (Mozilla-specific) |
| Cross-browser compatible | Yes — all major browsers | No — Firefox only |
| Preserves folder structure | Yes | Yes |
| Preserves tags | Partial (as flat folder) | Full |
| Preserves keyword shortcuts | No | No |
| Preserves favicons | Yes (Base64 inline) | Yes |
| File size | Larger (Base64 icons inflate size) | Smaller (LZ4 compression) |
| Human-readable | Yes | No (binary compressed) |
| Restore target | Any browser | Firefox only |
| Best use case | Migration, cross-browser sharing | Full Firefox profile backup |
| Automation-friendly | Yes (parseable HTML/XML) | Requires decompression step |
Practical recommendation: Use JSON backup (via Import and Backup > Backup) for routine Firefox profile snapshots, and HTML export for any cross-browser migration or external archival.
Automating Firefox Bookmark Backups
For users who want scheduled, hands-off bookmark backups — particularly relevant on systems running persistent browser sessions or automation stacks — a cron job provides a clean solution.
Linux Cron Job for Weekly Bookmark Backup
# Edit crontab
crontab -eAdd the following line to run every Sunday at 2:00 AM:
0 2 * * 0 sqlite3 -readonly "$HOME/.mozilla/firefox/$(ls $HOME/.mozilla/firefox | grep '.default-release')/places.sqlite" "SELECT url FROM moz_bookmarks JOIN moz_places ON moz_bookmarks.fk = moz_places.id WHERE moz_bookmarks.type = 1;" > "$HOME/backups/bookmarks_$(date +%Y-%m-%d).txt" 2>/dev/nullEnsure Firefox is not running during the scheduled backup window, or use a read-only SQLite connection (-readonly flag) to avoid locking conflicts.
Windows Task Scheduler Alternative
On Windows, use PowerShell to locate and copy the places.sqlite file to a backup directory:
$profilePath = Get-ChildItem "$env:APPDATAMozillaFirefoxProfiles" -Directory |
Where-Object { $_.Name -like "*.default-release" } |
Select-Object -First 1 -ExpandProperty FullName
$destination = "$env:USERPROFILEDocumentsFirefoxBackupsplaces_$(Get-Date -Format 'yyyy-MM-dd').sqlite"
Copy-Item "$profilePathplaces.sqlite" -Destination $destination
Write-Host "Backup saved to $destination"Firefox Sync vs. Local HTML Export: When to Use Each
Firefox Sync stores bookmarks in Mozilla's cloud infrastructure, syncing in real time across devices. It is convenient but introduces dependencies: a Mozilla account, an active internet connection, and trust in a third-party service.
Local HTML export is deterministic, offline, and format-agnostic. It does not require an account and works regardless of network conditions.
The two approaches are not mutually exclusive. A mature backup strategy uses both: Sync for real-time cross-device availability, and periodic HTML exports for versioned, offline-accessible snapshots stored in a location you control — such as a directory on a VPS Hosting instance running a personal file server or Nextcloud deployment.
Common Pitfalls and Edge Cases
Large bookmark libraries with many favicons: The HTML export embeds favicons as Base64 strings. A library with 5,000+ bookmarks can produce an HTML file exceeding 50 MB, which some browsers struggle to import. If you encounter import failures, strip favicons using a text editor or script before importing.
Locked database error during CLI export: As noted above, Firefox must be closed. On Linux, if Firefox crashed and left a lock file, remove ~/.mozilla/firefox/<profile-id>/places.sqlite-wal and places.sqlite-shm before attempting the query.
Duplicate bookmarks after import: Importing an HTML file into Firefox (rather than another browser) appends bookmarks without deduplication. If you import the same file twice, you will have duplicate entries. Use a browser extension or a deduplication script to clean up.
Encoding issues with non-ASCII characters: The Netscape Bookmark format specifies UTF-8 encoding, but some older export implementations default to the system locale. If bookmark titles contain Cyrillic, CJK, or Arabic characters, verify the exported file opens correctly before treating it as a reliable backup.
Profile corruption: If places.sqlite is corrupted (Firefox will usually warn you), the HTML export may be incomplete or fail silently. In this case, use Firefox's built-in profile recovery: navigate to about:support, click Open Profile Folder, and look for places.sqlite.corrupt — Firefox sometimes creates this automatically.
Storing and Managing Exported Bookmark Files
Once exported, treat the HTML file as a versioned artifact. Recommended storage practices:
- Name files with ISO 8601 dates:
bookmarks_2025-07-15.htmlmakes chronological sorting trivial - Store at least three versions: current, one month old, three months old
- Keep one copy off-device: a cloud storage bucket, a remote server, or an encrypted USB drive
- For teams: store the canonical bookmark file in a git repository to track additions and deletions over time with full diff history
If you manage multiple servers or client environments, keeping a centralized bookmark archive on a Dedicated Server with controlled access ensures the team always has access to the latest approved URL set.
Decision Matrix: Which Export Method Should You Use?
| Scenario | Recommended Method |
|---|---|
| One-time browser migration to Chrome/Edge | GUI HTML export |
| Regular personal backup (Firefox only) | Scheduled JSON backup via Import and Backup |
| Automated server-side archival | SQLite CLI query or Python script |
| Sharing bookmarks with a team | HTML export stored in shared repository |
| Full profile disaster recovery | Copy entire places.sqlite + key4.db |
| Cross-platform sync without Mozilla account | HTML export to self-hosted file server |
| Compliance/audit documentation | HTML export with date-stamped filenames |
Technical Key-Takeaway Checklist
- Export to HTML for cross-browser compatibility; use JSON backup for Firefox-only full-fidelity snapshots
- Verify exported files with a line count or bookmark count check — silent failures do occur
- Close Firefox completely before any direct
places.sqliteaccess to avoid database lock errors - HTML exports embed Base64 favicons; very large libraries may produce files that exceed browser import size limits
- Keyword shortcuts assigned to bookmarks are not preserved in either HTML or JSON exports — document them separately
- Automate exports with cron (Linux) or Task Scheduler (Windows) rather than relying on manual discipline
- Store versioned, date-stamped copies in at least two locations, one of which is off-device
- For team environments or server-based workflows, a self-hosted file server on a VPS with cPanel provides a convenient centralized bookmark archive with access controls
Frequently Asked Questions
Does exporting Firefox bookmarks also export passwords or browsing history?
No. The HTML export contains only bookmarks — URLs, titles, folder structure, and embedded favicons. Passwords are stored separately in key4.db and logins.json. Browsing history resides in places.sqlite but is not included in the bookmark export.
Can I export bookmarks from a specific folder only, not the entire library?
The native GUI export always exports all bookmarks. To export a specific folder, right-click the folder in the Library window — Firefox does not offer a per-folder export option natively. As a workaround, use the Python script approach and filter by moz_bookmarks.parent to target a specific folder ID.
Why is my exported bookmarks HTML file so large?
Firefox embeds favicons as Base64-encoded strings directly in the HTML file. A library with thousands of bookmarks from icon-heavy sites can produce files of 20–100 MB. To reduce file size, open the HTML file in a text editor and use a regex to strip ICON_URI and ICON attributes before importing into another browser.
Will importing the HTML file into Firefox create duplicates?
Yes, if you import into a Firefox profile that already contains those bookmarks. Firefox does not deduplicate on import. Use a dedicated browser extension for bookmark deduplication, or import into a fresh profile.
Is it safe to store the exported bookmarks HTML file on a shared hosting server?
The file itself contains only URLs and titles — no credentials. However, if your bookmarks include URLs to internal admin panels, private resources, or sensitive services, treat the file as sensitive. Store it in a password-protected directory or encrypt it before uploading to any Shared Web Hosting environment.
