OPFS
Origin Private File System

The Origin Private File System (OPFS) is a private, sandboxed file system built into modern web browsers that lets a website store files directly on your device, isolated from your regular files and from every other website. It is part of the browser's File System API, and it is what makes it possible for a web app to keep large files — like images and PDFs — locally, without uploading them to a server.

How OPFS works

OPFS storage is origin-scoped: files written by one origin — scheme, host and port together, so https://example.com and http://example.com are different origins — are visible only to that origin, never to other sites or to the operating system's normal file browser. Read that as isolation from other sites, not as confidentiality from code running with the origin's own authority: a cross-site scripting flaw or a privileged browser extension is inside the wall, not outside it. It also requires a secure context (HTTPS), and the synchronous access handles that make it fast are available only inside a Web Worker. The data lives in a private area the browser manages on your disk. Because it is designed for app storage rather than user-facing documents, it is fast, supports large files, and persists between visits — but it is sandboxed, so a page cannot use it to read or write anywhere else on your computer. Two limits worth knowing: OPFS shares one browser-managed quota with IndexedDB and the origin's other storage rather than having its own, and by default it is best-effort, meaning the browser may evict it under storage pressure unless the site has been granted persistence. It is not encrypted by the browser.

OPFS vs. IndexedDB vs. a cloud upload

Browsers give a web app two main local stores. IndexedDB is a structured database, ideal for text records such as chat messages. OPFS is a file system, ideal for binary blobs such as images and PDFs. Both keep data on your device. A traditional cloud upload does the opposite: your file leaves your device and is stored on a company's servers, where it can be retained, indexed, or breached. For a fuller walkthrough, see local browser storage for AI chats: IndexedDB and OPFS explained.

Why OPFS matters for private AI

In a private AI chat like Secret Chat AI, the files you attach to a prompt are held in OPFS, so your uploads and chat history stay on your own device rather than in a vendor's cloud account. Note the honest boundary: when you actually send a prompt, its text (and any attached content the model must read) still reaches the AI provider's API to be answered — OPFS governs where your history is stored, not what a model receives. See how the two halves fit together on private AI models.

Frequently Asked Questions

  1. Can other websites read my OPFS files?

    No. OPFS is origin-scoped, so only the origin that wrote a file can read it — that is scheme, host and port together — and other sites have no access. It is a wall against other sites, not against everything: code running on the site itself, whether legitimate or injected through a scripting flaw, and browser extensions with the right permissions, are on the inside of it.

  2. Where are OPFS files actually stored?

    In a private, browser-managed area on your own device's disk. They do not appear in your normal file explorer, and they are not uploaded anywhere by the storage mechanism itself.

  3. What happens to OPFS data if I clear my browser?

    It is deleted, just like other site data. Because the files live only in that browser on that device, clearing site data removes them, and a different device or browser profile simply never had them — which is why apps that use OPFS usually offer an export/import option.

Related terms: Zero-Retention API · Training Opt-Out · all glossary terms