Convert jsonlz4 to html

Convert JSONLZ4 to HTML

Export Firefox bookmark backups or render session-recovery JSONLZ4 files as local HTML.

Make HTML files online

We can't read JSONLZ4 files yet, so this conversion isn't available. If you can export your work to one of these formats - or others - we'll turn it into HTML:

How to convert jsonlz4 to html file

Firefox users may need an HTML bookmark file for another browser, a shareable link list, or an archive. A .jsonlz4 backup cannot be opened as a web page; the correct process depends on whether it is a Firefox bookmark backup or a session-recovery file.

What JSONLZ4 contains

JSONLZ4 is not a general-purpose document format. It usually means JSON compressed with Mozilla's LZ4 wrapper, whose files begin with the eight-byte signature mozLz40\0. Mozilla Firefox uses it for automatic bookmark backups and session-recovery data.

Files in a Firefox profile's bookmarkbackups folder contain bookmarks, folders, separators, and related bookmark metadata. Files such as recovery.jsonlz4, previous.jsonlz4, and upgrade.jsonlz4-* in sessionstore-backups contain saved windows, tabs, URLs, titles, and session state. Firefox's current bookmark database, places.sqlite, is not a JSONLZ4 file.

Find the active Firefox profile through Help → More Troubleshooting Information → Profile Folder → Open Folder. Copy the backup before working with it, because Firefox can replace session-recovery files while it runs.

What HTML provides

HTML is a browser-readable text format that can hold clickable links, headings, and bookmark-folder structure. Firefox's bookmark export uses the widely supported Netscape Bookmark HTML format, which Firefox, Chrome, Edge, and many other browsers can import; a session HTML file is instead a readable archive and cannot restore a browser session.

Export a Firefox bookmark backup

This is the preferred route for a file from bookmarkbackups; do not decompress it manually. In Firefox, first export or back up the current bookmarks, because restoring a backup replaces the existing bookmark set.

  1. Open Bookmarks → Manage Bookmarks.
  2. Select Import and Backup → Restore → Choose File, then select the copied .jsonlz4 bookmark backup.
  3. After Firefox restores it, select Import and Backup → Export Bookmarks to HTML and save the .html file.

The exported HTML preserves bookmark folders and is the appropriate file for importing bookmarks into another browser. Restoring a bookmark backup does not restore open tabs or session cookies.

Render a session backup as HTML

A file from sessionstore-backups cannot be restored through Firefox's bookmark menu or exported as bookmarks. Use a local Python 3 installation and the maintained lz4 package to decompress it and create a link list without uploading potentially sensitive tab titles, URLs, and search terms.

python -m pip install lz4
python jsonlz4_to_html.py recovery.jsonlz4 session.html

Save the following as jsonlz4_to_html.py. Firefox's payload is a raw LZ4 block without a stored uncompressed size, so the script increases the output buffer until decompression succeeds.

import html
import json
import sys
from pathlib import Path

import lz4.block


def decompress_mozlz4(data):
    if not data.startswith(b"mozLz40\0"):
        raise ValueError("Not a Firefox Mozilla-LZ4 JSON file.")
    payload = data[8:]
    size = max(1024, len(payload) * 4)
    while size <= 2 * 1024 ** 3:
        try:
            return lz4.block.decompress(payload, uncompressed_size=size)
        except lz4.block.LZ4BlockError:
            size *= 2
    raise ValueError("Unable to decompress the file.")


if len(sys.argv) != 3:
    raise SystemExit("Usage: python jsonlz4_to_html.py input.jsonlz4 output.html")

session = json.loads(decompress_mozlz4(Path(sys.argv[1]).read_bytes()))
parts = [
    "<!doctype html><meta charset='utf-8'><title>Firefox session tabs</title>",
    "<style>body{font:16px system-ui,sans-serif;margin:2rem;max-width:70rem}"
    "li{margin:.45rem 0;overflow-wrap:anywhere}small{color:#555}</style>",
    "<h1>Firefox session tabs</h1>",
]

for number, window in enumerate(session.get("windows", []), 1):
    parts.append(f"<h2>Window {number}</h2><ol>")
    for tab in window.get("tabs", []):
        entries = tab.get("entries", [])
        if not entries:
            continue
        try:
            index = int(tab.get("index", 1)) - 1
        except (TypeError, ValueError):
            index = 0
        entry = entries[max(0, min(index, len(entries) - 1))]
        url = str(entry.get("url", ""))
        title = str(entry.get("title") or url or "(untitled tab)")
        safe_url = html.escape(url, quote=True)
        safe_title = html.escape(title, quote=True)
        if url.startswith(("https://", "http://")):
            parts.append(f'<li><a href="{safe_url}" target="_blank" rel="noopener noreferrer">{safe_title}</a><br><small>{safe_url}</small></li>')
        else:
            parts.append(f"<li>{safe_title}<br><small>{safe_url}</small></li>")
    parts.append("</ol>")

parts.append("</html>")
Path(sys.argv[2]).write_text("\n".join(parts), encoding="utf-8")

Open session.html locally. The script creates links only for http:// and https:// URLs; about:, extension, and local-file addresses remain text to avoid activating non-web locations.

Compatibility and privacy limits

The session output records only each tab's selected history entry. It does not preserve back-forward history, cookies, logins, form fields, container identities, extension state, or suspended-tab state, and it cannot recreate the original session.

An unknown .jsonlz4 file may use a different LZ4 variant or contain unrelated JSON. On macOS or Linux, check the Firefox wrapper signature with xxd -l 8 filename.jsonlz4; if it is not mozLz40\0, do not use the Firefox-specific script.

There is no established reputable online service that directly converts Firefox JSONLZ4 session backups into safe HTML. General conversion sites require uploading browsing data and may not recognize Mozilla's wrapper; use local processing, or decompress and redact the JSON before considering any web-based tool.

JSONLZ4 vs HTML: format comparison

How the JSONLZ4 and HTML formats compare on the properties that matter most for this conversion.

Comparison of the JSONLZ4 and HTML file formats
Property .JSONLZ4 Mozilla JSONLZ4 session backup .HTML HyperText Markup Language
Opens in a web browser No Yes, natively
Plain-text readable No Yes
Text formatting None Extensive
Images No Yes
Interactive elements No Yes
Further editing Limited Easy
Typical file size Small Small
Open standard No Yes
Introduced — 1993
Developer Mozilla W3C / WHATWG
MIME type — text/html

The database currently does not contain any direct jsonlz4 file converter links.

Additional formats for
jsonlz4 file conversion

Convert to html from
other formats

Share on social media: