Developer and Text Tools

How to Open an Avro File and Convert It to JSON or CSV

What is inside an Apache Avro file, how schemas, codecs and logical types work, and how to view records and export JSON, CSV or Excel in your browser.

Saizul Amin
Saizul Amin3 Nov 2026 · 3 min read
How to Open an Avro File and Convert It to JSON or CSV

Apache Avro is everywhere in data engineering: Kafka topics, Spark and Hadoop jobs, cloud warehouse exports and event pipelines. It is compact and safe because every file carries its own schema. It is also binary, so double-clicking an .avro file shows nothing useful. This guide explains what is inside the file and how to look at it quickly.

Anatomy of an Avro file

The usual .avro file is an object container file. It has three parts:

  1. A header. Four magic bytes, Obj and the version 1, followed by metadata. The two important entries are avro.schema, the JSON schema of the records, and avro.codec, the compression used.
  2. A sync marker. Sixteen random bytes that also appear after every block.
  3. Data blocks. Each block holds a count of records, the size in bytes, the compressed records and the sync marker again.

The repeated sync marker lets readers split big files and detect corruption: if the bytes after a block do not match, the file is damaged or cut short.

Schemas and types

Records are stored without field names. The schema says what comes next: a long, then a string, then an array of strings, and so on. Avro has primitive types (null, boolean, int, long, float, double, bytes, string) and complex types (record, enum, array, map, union and fixed). Integers use a compact zig-zag variable-length encoding, so small numbers take one byte.

A union such as ["null", "double"] is how Avro writes an optional field. Logical types add meaning to plain types: a long with timestamp-millis is a point in time, an int with date is a day count since 1970, and decimal stores exact amounts with a scale.

Codecs

Blocks can be stored uncompressed (null), with deflate, or with snappy, which is popular in Kafka and Spark for its speed. Other codecs such as zstandard exist but are less common in exported files.

Viewing a file

The Avro File Viewer and Converter decodes container files in the browser.

  1. Drop the .avro file on the Open tab.
  2. Read the summary: record count, number of blocks, codec and size.
  3. Open the schema panel to see field names and types. This alone answers many questions, such as whether a field is optional.
  4. Toggle Show logical types to switch between readable dates and the stored numbers. This is the fastest way to tell milliseconds from microseconds.
  5. Choose whether nested records stay as JSON cells or become columns, and use the search box to filter.
  6. Export all records as JSON or JSON Lines, the current table as CSV or Excel, or the schema as an .avsc file for code generation.

Large long values that JavaScript cannot represent exactly are shown as strings, so an ID never loses digits.

Writing a small Avro file

Tests and demos often need a sample file. On the second tab, paste a JSON array of records. A schema is inferred: whole numbers become int or long, other numbers double, nested objects records, and fields that are missing or null somewhere become optional unions with a null default. Edit the schema if you want, for example to add a timestamp logical type, choose deflate or no compression, and download. The round-trip test reads the new file back to confirm it is valid.

Limits

Single Avro messages without the container header, as stored in many Kafka topics with a schema registry, need the schema from the registry and are not opened here. The zstandard, bzip2 and xz codecs are not supported. The viewer loads up to 200,000 records, enough for inspection but not for analysing huge files, and it decodes with the writer schema only.

Summary

An Avro file is a header with a schema, a sync marker and compressed blocks. Once you can see the schema and a table of records, most questions answer themselves, and exporting to JSON or CSV makes the data easy to share.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages