What this NetCDF header inspector validates
The parser follows the big-endian CDF-1 and CDF-2 binary grammar: magic and version, record count, dimension list, global attributes, variable list, variable attributes, classic primitive types, 4-byte header padding, 32-bit declared variable sizes, and 32- or 64-bit data offsets. Names are decoded as strict UTF-8 and checked for empty, prohibited, trailing-whitespace, and non-NFC forms.
Dimensions, variables, and records
Dimension IDs are resolved into readable shapes. The audit identifies the single allowed unlimited dimension, verifies that it is first when a variable uses it, checks duplicate names and _FillValue type/count, compares each declared vsize with the padded type-and-shape calculation, and distinguishes fixed-size from interleaved record variables. A one-variable BYTE, CHAR, or SHORT record layout uses the classic unpadded-record special case.
Offsets and physical file bounds
Declared begins are sorted independently for fixed and record variables. The page detects data beginning inside the header, overlapping extents, fixed variables beyond the physical file, and finite record slabs that require bytes beyond the file. Large files do not need to be loaded in full: the browser reads a maximum 16 MiB prefix for the header while retaining the actual local file size for these checks.
Scientific interpretation boundary
A structurally clean header does not prove that the data values, units, coordinates, conventions, or science are correct. This tool does not decode array values, validate CF or other community conventions, follow external metadata, calculate checksums, repair files, or replace ncdump, ncvalidator, the netCDF library, xarray, or a domain-specific viewer. It intentionally does not parse CDF-5 or HDF5-based NetCDF-4. Use current libraries to validate and read the complete dataset.
Frequently asked questions
Why does my .nc file say HDF5?
Many modern NetCDF-4 files use HDF5 as their physical container. The .nc extension alone does not identify the binary format. This page recognizes the HDF5 signature but does not pretend that HDF5 uses the classic CDF header grammar.
What is the difference between CDF-1 and CDF-2?
Both use the classic data model. CDF-2 stores each variable's begin offset as a 64-bit value so data can be placed beyond classic 32-bit offsets; most other header structures remain the same.
Does the audit read my whole multi-gigabyte file?
No. It reads at most the first 16 MiB. The browser-provided file size is used to check declared data extents. If the header itself exceeds that prefix, the tool stops explicitly.
Can a valid file still fail a CF checker?
Yes. CF conventions add semantic rules for coordinates, units, standard names, missing data, and more. Those rules are outside this binary-layout audit.
Authoritative format references
The byte grammar and type layout follow Unidata's NetCDF classic and 64-bit offset file-format specification. The separation between header, fixed-size data, and record data follows Unidata's file structure and performance guide. Use official netCDF utilities for full validation and access.
Inspect MARC 21 records · Analyze a linker map · Browse scientific-data tools