Safetensors Header Inspector
Read a .safetensors header slice only — tensor names, shapes, dtypes, offsets, parameters and memory, entirely in your browser.
Safetensors files
no filesHeader report
Drop a .safetensors file to inspect its header
Only the first few kilobytes are read — a 40 GB checkpoint opens just as fast.
Examples
BF16 attention weight
blk.0.attn.q.weight · BF16 · [32, 64] · offsets [0, 4096]2,048 params · 4.0 KB · absolute start 8 + header lengthExpected bytes equal 2,048 × 2, so the row has no mismatch flag.
Scalar step counter
steps · I64 · [] · offsets [74752, 74760]1 param · 8 bytesAn empty shape is treated as one element, not zero.
Corrupt span
weights · F32 · [2, 2] · offsets [0, 4]4 params · 4 bytes · byte/size mismatchFour F32 elements need 16 bytes; the short span is flagged amber.
About this tool
Safetensors Header Inspector opens the small JSON header at the front of a .safetensors checkpoint. It reads an 8-byte little-endian length, slices out the header, and turns the tensor table into a readable inventory — names, dtypes, shapes, offsets, parameter counts and memory use — without reading a single weight byte.
Derived statistics do the real work: per-dtype tensor and byte totals, a parameter count from shape products, each tensor's share of the data section, and warnings for unknown dtypes, impossible offsets, overlapping spans or shape/span disagreements. Drop multiple shards to combine their totals and reveal duplicate tensor names that would otherwise quietly undercount a checkpoint.
Search names by substring or regular expression, filter by dtype or a preset such as attention and LoRA, inspect the verbatim header JSON and __metadata__, then export a CSV inventory or Markdown summary. Parsing stays in your browser tab; a 40 GB file opens as fast as a small one because only the header is sliced.
What this tool does not do
- Tensor data, statistics and values are never inspected.
- Only local files are supported; remote URLs and range requests are out of scope.
- The element-size table covers the published dtype set; a future dtype is reported as unknown instead of guessed.
- Very large tables render 200 rows at a time with a show-more control rather than full virtualization.
- Quantization figures are informational arithmetic, not a conversion plan.
How to use this tool
Drop a checkpoint
Choose or drop one or more .safetensors files, or load the built-in synthetic sample to explore the UI.
Read the summary
Check total parameters, tensor bytes and the per-dtype table; amber rows and warnings identify header problems.
Find a tensor
Filter by name (optionally as regex), dtype or a preset, then sort by bytes, parameters, name or dtype.
Export the evidence
Copy the filtered inventory as CSV, download it, or save a Markdown header summary for a bug report.
Use cases
Checkpoint audit
Verify which tensors a fine-tune saved and whether dtypes match the training config.
Memory planning
Sum bf16/fp16 bytes before estimating q8 or q4 footprint for a deployment.
Shard review
Aggregate model-00001-of-00004 style shards and catch duplicated tensor names.
Header fields shown
| Field | Meaning |
|---|---|
| dtype | Element type such as F32, BF16, F16, I64; drives the element-size cross-check. |
| shape | Dimension list; an empty list is a scalar with one parameter. |
| data_offsets | Start and end relative to the data section; absolute position is 8 + header length + offset. |
| params | Product of the shape dimensions (1 for scalars). |
| bytes | Offset span, compared with params × element size for mismatch flags. |
| share | Percent of the declared data section occupied by the tensor. |
Span checks use the declared data section, not the whole file, so a correctly packed file is never false-flagged.
Common mistakes
Mistake:Assuming offsets are absolute file positions.
Fix:They start at the beginning of the data section, after the length prefix and header.
Mistake:Treating q8/q4 estimates as exact deployment sizes.
Fix:Scales, zero points and sensitive layers add overhead; use a VRAM calculator for budgets.
Mistake:Expecting tensor values or min/max statistics.
Fix:This tool is header-only by design; weights are never read.
Mistake:Using this for GGUF files.
Fix:GGUF has a different metadata layout; use a GGUF metadata inspector instead.
Mistake:Pasting exported tensor names into a spreadsheet without checking.
Fix:CSV cells beginning with formula characters are neutralised with an apostrophe.
Frequently asked questions
How is a safetensors header structured?
The file starts with an unsigned 64-bit little-endian integer giving the header length in bytes. Those bytes are UTF-8 JSON mapping each tensor name to an object with dtype, shape and data_offsets. An optional __metadata__ object holds string key/value pairs. Tensor weights follow the header; the inspector only reads the prefix and never touches them.
How do I count parameters in a safetensors file?
For every tensor, multiply the shape dimensions (a scalar with shape [] counts as one), then add the results. The summary card does this for all tensors and the dtype table breaks the count down by element type. It matches the checkpoint's parameter count as long as the header lists every tensor.
Does it read the tensor data?
No. The reader asks the browser for the first eight bytes to learn the header length, then slices exactly those header bytes. A 40 GB checkpoint therefore opens about as quickly as a tiny one, and no weights are loaded into memory or uploaded anywhere.
What dtypes can it show?
The published safetensors element sizes are covered: BOOL, U8, I8, I16, I32, I64, F8_E4M3, F8_E5M2, F8_E8M0, F16, BF16, F32 and F64. A dtype outside this table is not guessed: its row is counted separately and flagged so a newer format variant is visible rather than silently mis-sized.
Can it handle multi-GB files and sharded checkpoints?
Yes for both. File size does not matter because only the header is sliced. Drop several shards at once to get combined parameter and byte totals, a merged dtype breakdown, and warnings for tensor names that appear in more than one shard. Completeness against an index.json weight map is not checked.
Why is a tensor row flagged amber?
Possible reasons are an unknown dtype, an invalid shape, offsets outside the declared data section, overlapping spans, or a byte span that differs from parameters × element size. The row lists the flags, and a summary warning counts the affected tensors so a malformed header is hard to miss.
Are my model files uploaded or stored?
No. Slicing, parsing, analysis and exports all happen in the browser tab. Nothing is sent to a server, no file contents are saved, and the downloaded CSV or Markdown is generated locally.
References & standards
Related tools
Agent Tool Flowchart Builder
Design agentic tool-call DAGs with decision branches and bounded loops. Validates reachability, cycle handling, and emits clean Mermaid flowcharts — fully in your browser.
AI Agent Memory & Buffer Simulator
Compare sliding window, summary buffer, and vector memory strategies
AI API Client SDK Generator
Generate typed API client SDK files from OpenAPI specifications or cURL requests
AI Code Explainer
Explain code snippets with grounded cloud AI
AI Code Security Auditor
Scan source code for high-confidence OWASP Top 10 vulnerabilities
AI Code Translator
Translate code into idiomatic implementations in another language