Understanding the Microsoft Outlook MSG Binary Format
An MSG (.msg) file is a binary file format created by Microsoft Outlook and Microsoft Exchange to store a single messaging object outside of an Outlook storage database (.pst or .ost). Unlike standard Internet emails encoded in plain-text MIME format (.eml), an MSG file is structured as a Compound File Binary Format (CFBF) container—often referred to as an OLE 2.0 Compound Document.
Inside this compound container, an MSG file functions as an internal virtual file system composed of storages (directories) and streams (files):
- Root Storage: Houses top-level MAPI property streams, including subject lines, sender names, delivery timestamps, and sensitivity flags.
- Recipient Storages: Individual sub-storages for each To, Cc, and Bcc recipient, cataloging display names, email addresses, and Exchange address types.
- Attachment Storages: Dedicated sub-storages for every file attachment, containing the raw binary payload, filename, MIME type, and rendering position tags.
- Named Property Stream: Stores custom metadata and extended Outlook attributes such as categories, task reminders, and flag statuses.
Why an In-Browser MSG Viewer is Essential
Because the MSG format is fundamentally a proprietary Windows OLE structure, opening an MSG file outside of the Microsoft Windows ecosystem has traditionally been a major pain point. Common scenarios include:
- Mac and Linux Workstations: Apple Mail and Linux desktop clients cannot natively interpret OLE compound structures, rendering MSG files unreadable without specialized commercial tools.
- Mobile Devices and Tablets: iOS and Android lack built-in CFBF decoders, preventing mobile professionals from previewing dragged-and-dropped Outlook attachments on the go.
- Legacy and Archival Retrieval: Legal discovery teams, compliance officers, and forensic investigators frequently encounter thousands of historical MSG files requiring rapid review without launching heavy desktop software.
- Security and Confidentiality Concerns: Many web-based converters upload files to remote servers, violating corporate data privacy policies.
The HiFi Toolkit Online MSG Viewer solves these challenges by decoding compound binary streams entirely inside client-side JavaScript memory, delivering instantaneous, private message rendering.
Technical Comparison: MSG vs. EML vs. PST
| Feature | MSG (.msg) | EML (.eml) | PST (.pst) |
|---|---|---|---|
| Scope | Single item (Email, Contact, Task, Calendar) | Single email message | Entire mailbox archive (Folders, Messages) |
| Underlying Container | Compound File Binary (CFBF / OLE) | Plain text RFC 822 / 5322 MIME | NDB B-Tree Database |
| Native Client | Microsoft Outlook (Windows) | Apple Mail, Thunderbird, Windows Mail | Microsoft Outlook |
| MAPI Properties Support | Full native support | Partial / Converted to MIME headers | Full native support |
| Human Readability | Binary only (requires parser) | Plain text readable in Notepad | Binary database (requires parser) |
Step-by-Step: How to Open and Read an MSG File
- Upload or Drag File: Click Open MSG File above or drag and drop your
.msgfile directly into the viewer box. - Browse Message Body: Seamlessly toggle between:
- HTML View: Render formatted email messages with original tables, fonts, and inline styles.
- Plain Text View: Read clean text without formatting.
- MAPI Properties View: Inspect technical hexadecimal tags (e.g.,
0x0037forPR_SUBJECT).
- Download Attachments: If the message contains attachments, click on any attachment badge to download the extracted file directly.
- Print or Export: Use the Print button to print or save to PDF, or export the structured message to JSON.
The Internal Architecture of CFBF (Compound File Binary Format)
An Outlook .msg file is not a standard text stream; it is a full virtual filesystem encapsulated inside a single binary container, formalized under Microsoft's Compound File Binary Format (CFBF / OLE 2.0):
- Sector Allocation Table (FAT): Divides the file into fixed 512-byte (or 4096-byte in version 4) sectors. The FAT chains sectors together to assemble fragmented variable-length data streams.
- Directory Stream (Red-Black Tree): An internal indexing tree composed of 128-byte directory entries. Each directory entry represents a "Storage" (analogous to a directory folder) or a "Stream" (analogous to an individual file).
- MiniFAT Architecture: Small streams less than 4096 bytes are diverted into a specialized Mini-Stream managed by a MiniFAT table, preventing internal sector fragmentation and reducing disk overhead.
MAPI Property Streams & Tag Identifiers
Inside the CFBF root storage, Outlook organizes metadata using Microsoft Messaging Application Programming Interface (MAPI) property streams. Each stream is named with the prefix __substg1.0_ followed by an 8-character hexadecimal identifier:
| MAPI Property Tag | Canonical Name | Technical Payload Function |
|---|---|---|
0x0037001F | PR_SUBJECT_W | UTF-16LE encoded Unicode email subject line string. |
0x0C1F001F | PR_SENDER_EMAIL_ADDRESS_W | Sender email address or internal Exchange X.500 distinguished name. |
0x1000001F | PR_BODY_W | Unformatted plain text body stream. |
0x10130102 | PR_HTML | Raw binary HTML markup stream. |
0x10090102 | PR_RTF_COMPRESSED | LZFu-compressed Rich Text stream storing legacy Word-formatted Outlook bodies. |
__attach_version1.0_# | Attachment Storage | Sub-storage housing attachment filename (0x3707001F) and raw binary data (0x37010102). |
Compressed RTF (LZFu) Body Decompression
When Microsoft Outlook composes emails using Microsoft Word as its rendering engine, it does not store HTML directly. Instead, it encapsulates formatted text into an LZ77-variant stream called LZFu (LZ-Form of uncompressed). This format prepends a 16-byte header containing a 0x414d454a magic signature ("MAPI" reversed) and a CRC-32 checksum. To display the message, our client-side engine executes in-memory LZFu dictionary decompression to recover the underlying RTF document before synthesizing clean HTML.
Exchange Server MAPI Transport & Storage Interfaces
The MAPI architecture separates messaging subsystems into three distinct components: Address Book Providers (querying LDAP and Exchange Global Address Lists), Transport Providers (delivering items over RPC/HTTP or MAPI-over-HTTP), and Message Store Providers (managing mailboxes and public folders).
When an email item is dragged from Outlook onto a user's desktop, the Message Store serializes the internal MAPI object graph into the standalone Compound File structure. The HiFi Toolkit viewer reverses this serialization in memory, rebuilding human-readable message properties without requiring Microsoft Exchange or Outlook libraries.
Zero-Trust Privacy & Confidentiality Guarantee
Corporate communications, customer contracts, and internal correspondence represent sensitive data. Uploading MSG files to third-party web servers creates substantial data leakage risks under GDPR, HIPAA, and CCPA regulations.
HiFi Toolkit's MSG Viewer guarantees 100% in-browser confidentiality:
- In-Memory Processing: The file is ingested using browser
ArrayBufferAPIs locally on your computer. - Zero Server Communication: No data packets, email text, or attachments are ever transmitted to external servers.
- Sanitized Output: HTML body streams are sanitized inside secure containers to protect your device against tracking scripts and malicious code.