Skip to content

NetCDF (.cdl)

.cdl file signature | application/octet-stream

NetCDF (Network Common Data Form) is a data format developed and maintained by Unidata, part of the University Corporation for Atmospheric Research (UCAR). It is used to store and share array-oriented scientific data in fields such as meteorology, oceanography, climate research, and geoscience, often alongside analysis and visualization tools. The format is generally considered safe, though files may be large or malformed and should be handled carefully by applications that parse external data.

Safe

Magic Bytes

Offset 0
6E 65 74 63 64 66 20

Sources: Gary Kessler

Extension

.cdl

MIME Type

application/octet-stream

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .cdl files in Python

Python
def is_cdl(file_path: str) -> bool:
    """Check if file is a valid CDL by magic bytes."""
    signature = bytes([0x6E, 0x65, 0x74, 0x63, 0x64, 0x66, 0x20])
    with open(file_path, "rb") as f:
        return f.read(7) == signature

How to validate .cdl files in Node.js

Node.js
function isCDL(buffer: Buffer): boolean {
  const signature = Buffer.from([0x6E, 0x65, 0x74, 0x63, 0x64, 0x66, 0x20]);
  return buffer.subarray(0, 7).equals(signature);
}

How to validate .cdl files in Go

Go
func IsCDL(data []byte) bool {
    signature := []byte{0x6E, 0x65, 0x74, 0x63, 0x64, 0x66, 0x20}
    if len(data) < 7 {
        return false
    }
    return bytes.Equal(data[:7], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .cdl file?

A .cdl file is a NetCDF file. NetCDF (Network Common Data Form) is a data format developed and maintained by Unidata, part of the University Corporation for Atmospheric Research (UCAR). It is used to store and share array-oriented scientific data in fields such as meteorology, oceanography, climate research, and geoscience, often alongside analysis and visualization tools. The format is generally considered safe, though files may be large or malformed and should be handled carefully by applications that parse external data.

What are the magic bytes for .cdl files?

The magic bytes for NetCDF files are 6E 65 74 63 64 66 20 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .cdl file?

To validate a .cdl file, read the first bytes of the file and compare them against the known magic bytes (6E 65 74 63 64 66 20) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .cdl files?

There is no officially registered MIME type for .cdl files. Systems typically use application/octet-stream as a generic fallback when handling this format.

Is it safe to open .cdl files?

NetCDF (.cdl) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.