ONETOC2

application/onenote;format=onetoc2

Safe

Magic Bytes

Offset: 0
43 FF 2F A1

The ONETOC2 format is a binary index file created and maintained by Microsoft as part of the OneNote application suite. It serves as a table of contents that organizes sections, pages, and subpages within a notebook folder, facilitating navigation and synchronization. These files are considered low risk as they contain structural metadata rather than executable content, although they remain critical for maintaining notebook integrity in legacy local storage configurations.

Extension

.onetoc2

MIME Type

application/onenote;format=onetoc2

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .onetoc2 files in Python

Python
def is_onetoc2(file_path: str) -> bool:
    """Check if file is a valid ONETOC2 by magic bytes."""
    signature = bytes([0x43, 0xFF, 0x2F, 0xA1])
    with open(file_path, "rb") as f:
        return f.read(4) == signature

How to validate .onetoc2 files in Node.js

Node.js
function isONETOC2(buffer: Buffer): boolean {
  const signature = Buffer.from([0x43, 0xFF, 0x2F, 0xA1]);
  return buffer.subarray(0, 4).equals(signature);
}
Go
func IsONETOC2(data []byte) bool {
    signature := []byte{0x43, 0xFF, 0x2F, 0xA1}
    if len(data) < 4 {
        return false
    }
    return bytes.Equal(data[:4], signature)
}

API Endpoint

GET /api/v1/onetoc2
curl https://filesignature.org/api/v1/onetoc2

Related Formats