Avro Object Container Files · null, deflate and snappy

Avro File Viewer

Open an .avro file to read the schema stored in its header, browse the records as a table and export them as JSON or CSV. The writer schema comes from the file itself, so there is nothing else to supply.

Avro file

Drop an .avro file

Up to 128.0 MB; the first 100,000 records are decoded

Choose an .avro file, or load the example to see what the viewer shows.

Avro File Viewer

Operator: Abdulla Al Fahad. How tools are built and checked

Avro files from Kafka Connect sinks, Hadoop jobs and lakehouse exports are binary, so a text editor shows a JSON schema followed by noise. The schema is stored in the file's own header, so it is enough to decode every record, and this page needs nothing but the file.

Four views show the same data: a table with optional dotted columns for nested records, the field list and full schema (downloadable as .avsc), a JSON preview, and exports to JSON, JSON Lines or CSV. Reading stops at documented limits instead of exhausting memory.

Key features

  • Reads Avro Object Container Files with null, deflate and snappy codecs, and checks each snappy block against its CRC-32
  • Decodes every Avro type: primitives, records, enums, arrays, maps, fixed, unions and named references, including recursive types
  • Optional logical-type formatting for date, time-millis, time-micros, timestamp and local-timestamp in millis and micros, decimal, uuid and duration
  • Keeps longs beyond 2^53 exact by writing them as strings
  • A table of 50 rows per page, a schema field list, a JSON preview and downloads

What the reader decodes and where it stops

A container file starts with the bytes Obj and 0x01, then a metadata map that must hold avro.schema (JSON) and may hold avro.codec, then a 16-byte sync marker, then blocks made of a record count, a byte size, the data and the sync marker again. The reader checks the marker after every block and names the block that fails.

Bytes and fixed values become base64, enums become their symbol, a union shows the value of the branch used, NaN and infinite floats become strings, and longs outside the safe integer range become strings so no digit is lost. With logical types on, a date becomes 2022-04-19, timestamp-millis becomes an ISO string ending in Z and a decimal becomes text with its scale applied, such as 124.46; turn the option off to see the stored numbers. A decimal whose precision or scale the Avro spec does not allow (scale above precision, precision over 1,000, or a fixed size too small for the precision) is read as its underlying bytes, and a notice says so.

Limits: a 128 MB file, 1 MB for the schema and for each metadata entry, 64 MB per block after decompression and 256 MB in total, 100,000 decoded records, 6 million decoded values and 100 levels of nesting. Records past 100,000 are counted from the block headers but not decoded, and a notice says how many were.

How it works

Deflate blocks are inflated with the browser's DecompressionStream in deflate-raw mode. Real output bytes are counted as they arrive and the stream is cancelled the moment a cap is crossed, so a small compressed block cannot expand into memory; sizes declared in the file are never trusted.

Snappy is decoded by a small built-in routine covering literals and the three copy forms, which checks every offset and the declared length. Avro appends a big-endian CRC-32 of the uncompressed bytes to each snappy block, and that value is verified.

Every length is validated before use. An array or map count must fit in the bytes that remain, using the smallest encoded size of its item type, so a corrupt count of a trillion fails at once instead of looping.

When this helps

  • A data engineer opens a 12 MB Kafka Connect sink file to find out why a consumer fails. The Schema tab shows customer as union<null | string>, and the table shows null in three rows the consumer treated as text.
  • An analyst receives a 40 MB snappy export from a Hadoop job and needs it in Excel. Download CSV spreads address.city and address.zip into columns and writes arrays as JSON text in one cell.
  • A QA engineer loads the files from before and after a schema change and compares the two field lists to confirm the new field arrived with its default.

Opening a file

  1. Drop an .avro file on the page.
  2. Open the Schema tab to read field types, defaults and docs, or download the schema as .avsc.
  3. Browse the table, switching logical-type formatting and dotted columns as needed.
  4. Read any notice about limits, such as how many records were decoded.
  5. Download JSON, JSON Lines or CSV.

Example

An orders file with schema Order: 1,212 bytes, 2 deflate blocks, 4 records; the first record as stored

Schema: id long, customer union<null | string>, status enum NEW|PAID|SHIPPED, total bytes decimal(10,2), created long timestamp-millis, day int date, tags array<string>, attrs map<int>, address record(city, zip)
First record as stored: id 101, total bytes 0x309E, created 1700000101000, day 19101

The same fields with logical types on, then off

On:  total "124.46", created "2023-11-14T22:15:01.000Z", day "2022-04-19"
Off: total "MJ4=", created 1700000101000, day 19101

Limits

Only container files are read. A bare Avro message, such as a Kafka value with a Confluent wire-format header, carries no schema, so it fails the first-bytes check.

Records are decoded with the file's own writer schema, and no reader schema is applied. Schema evolution (renamed fields, promoted types, defaults for missing fields) is not resolved here.

A union shows the value without naming its branch, so an int 1 and a long 1 look the same.

  • Turn logical types off to see what is stored: dates as day counts, timestamps as milliseconds and decimals as base64 bytes, which is what a consumer without logical-type support receives.

Common errors and how to fix them

"This is not an Avro Object Container File: it does not start with the bytes Obj followed by 0x01."
The file is a different format (Parquet, ORC, JSON) or raw Avro data with no container. If it should be a container file, check that the download was not an HTML error page.
"Block 3 does not end with the file's sync marker, so the file is damaged."
A cut-off transfer or a text-mode copy changed bytes. Copy the file again in binary mode; the message names the first bad block, so earlier blocks were fine.

Codecs that are not supported

bzip2, xz and zstandard are valid Avro codecs, but their blocks are not decoded here and the notice names the codec it found. Rewrite the file with the deflate, snappy or null codec in the tool that produced it.

What the Schema tab shows

The tab lists the top-level record's fields with type labels such as union<null | string>, array<string>, fixed(3) and long (timestamp-millis), then the full JSON, which downloads as .avsc. A name without a dot is looked up in the namespace of the record that contains it and then in the empty namespace, and a type defined in another namespace keeps resolving its own inner names against the namespace it was defined in.

Frequently asked questions

How is this different from MessagePack, CBOR and BSON to JSON here?

Those formats carry field names and types inside every value, so a decoder needs no schema. Avro data has neither, so it can only be read with the writer schema, which a container file stores in its header and which this page therefore needs the whole file to find.