AvroConvert 4.0.0-preview.2

This is a prerelease version of AvroConvert.
dotnet add package AvroConvert --version 4.0.0-preview.2
                    
NuGet\Install-Package AvroConvert -Version 4.0.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AvroConvert" Version="4.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AvroConvert" Version="4.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="AvroConvert" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AvroConvert --version 4.0.0-preview.2
                    
#r "nuget: AvroConvert, 4.0.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AvroConvert@4.0.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AvroConvert&version=4.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AvroConvert&version=4.0.0-preview.2&prerelease
                    
Install as a Cake Tool

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./docs/logo-dark.png"> <img alt="SolTechnology / AvroConvert" src="./docs/logo.png" width="300"> </picture> </p>

<p align="center"> Rapid Apache Avro serializer for .NET </p>

<p align="center"> <a href="https://github.com/AdrianStrugala/AvroConvert"><img src="https://img.shields.io/github/stars/AdrianStrugala/AvroConvert.svg?label=%E2%98%85%20Stars%20%E2%98%85&color=yellow&style=flat&logo=github"></a> <a href="https://soltechnology.dev/avroconvert/online/"><img src="https://img.shields.io/badge/AvroConvertOnline-Try%20Now-4C6A8A.svg?logo=google-chrome"></a> <br> <a href="https://github.com/AdrianStrugala/AvroConvert/actions/workflows/build&test.yml"><img src="https://img.shields.io/github/actions/workflow/status/AdrianStrugala/AvroConvert/build%26test.yml?label=Build%26Test&logo=github"></a> <a href="./L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MtLjUzLjUyOS41MzEtLjAwMS4wMDItLjAwMi4wMDItLjAwNi4wMDYtLjAxNi4wMTUtLjA0NS4wNGMtLjIxLjE3Ni0uNDQxLjMyNy0uNjg2LjQ1QzQuNTU2IDEwLjc4IDMuODggMTEgMyAxMWE0LjQ5OCA0LjQ5OCAwIDAgMS0yLjAyMy0uNDU0IDMuNTQ0IDMuNTQ0IDAgMCAxLS42ODYtLjQ1bC0uMDQ1LS4wNC0uMDE2LS4wMTUtLjAwNi0uMDA2LS4wMDQtLjAwNHYtLjAwMWEuNzUuNzUgMCAwIDEtLjE1NC0uODM4TDIuMTc4IDQuNUgxLjc1YS43NS43NSAwIDAgMSAwLTEuNWgyLjIzNGEuMjQ5LjI0OSAwIDAgMCAuMTI1LS4wMzNsMS4yODgtLjczN2MuMjY1LS4xNS41NjQtLjIzLjg2OS0uMjNoLjk4NFYuNzVhLjc1Ljc1IDAgMCAxIDEuNSAwWm0yLjk0NSA4LjQ3N2MuMjg1LjEzNS43MTguMjczIDEuMzA1LjI3M3MxLjAyLS4xMzggMS4zMDUtLjI3M0wxMyA2LjMyN1ptLTEwIDBjLjI4NS4xMzUuNzE4LjI3MyAxLjMwNS4yNzNzMS4wMi0uMTM4IDEuMzA1LS4yNzNMMyA2LjMyN1oiLz48L3N2Zz4%3D"></a> <a href="https://www.nuget.org/packages/AvroConvert"><img src="https://img.shields.io/nuget/dt/AvroConvert.svg?label=NuGet%20Downloads&logo=nuget&color=blue"></a> </p>

Docs

AvroConvert documentation

Apache Avro specification

First steps with Avro in .NET

Why AvroConvert

Avro combines the self-describing schema of JSON with the size and speed of binary serialization. AvroConvert brings it to .NET the way you already serialize JSON: plain C# objects in, byte[] out – no code generation, no .avsc files.

AvroConvert Apache.Avro Newtonsoft.Json
Works on plain C# classes – no generated code or schema files ✔️ ❌ ✔️
Native .NET types (Dictionary, List, DateTime, Guid, decimal…) ✔️ ❌ ✔️
Compact binary payload ✔️ ✔️ ❌
Schema stored with the data – readable, versionable, evolvable ✔️ ✔️ ❌
Compression codecs Deflate · Snappy · Zstandard · GZip · Brotli (built-in) Deflate (others via add-ons) ❌
Serialization time 1× 6× slower 5× slower
Deserialization time 1× 9× slower 3× slower
Memory allocated 1× 3× more 2× more
Payload size, uncompressed 1× 1× 2.9× larger

What it means for your services:

  • Smaller data – a 1 000-record payload is 2.9× smaller than JSON before compression, and codecs shrink it further → lower storage and network cost
  • Faster round trips – less time spent in serialization and on the wire between microservices
  • Safer by default – binary on the wire is not readable in plain text, and the embedded schema protects against silent shape drift

Benchmarks: raw results · benchmarks/LibrariesBenchmark

Features

  • Serialization
 byte[] avroObject = AvroConvert.Serialize(object yourObject);

<br/>

  • Deserialization
CustomClass deserializedObject = AvroConvert.Deserialize<CustomClass>(byte[] avroObject);

<br/>

  • Read schema from Avro object
string schemaInJsonFormat = AvroConvert.GetSchema(byte[] avroObject)

<br/>

  • Streaming of large collections, item by item
AvroConvert.Serialize(items, fileStream);

await foreach (var item in AvroConvert.Deserialize<CustomClass>(stream))
{
    // process item
}
  • Generation of C# models from Avro file or schema
  string resultModel = AvroConvert.GenerateModel(avroObject);
  • Conversion of Avro to JSON directly
  var resultJson = AvroConvert.Avro2Json(avroObject);

Extended list: <br>

  1. Serialization of .NET object to Avro format
  2. Deserialization of Avro data to .NET object
  3. Other Avro data related operations
  4. Customization
  5. Schema related
  6. Integrations

Full documentation

License

AvroConvert is source-available. Noncommercial use and small companies pay nothing; everyone else buys a yearly licence for the whole organisation.

You are… Licence Cost
Individual, student, non-profit, public institution, research or evaluation PolyForm Noncommercial 1.0.0 Free
Company with fewer than 100 people and under 1,000,000 USD annual revenue PolyForm Small Business 1.0.0 Free
Any other company or organisation Commercial Licence — Business under 1,000 people, Enterprise from 1,000 people, listed companies and public sector Annual, per organisation, unlimited developers — buy at soltechnology.dev

Say which licence you rely on, in code or through the AVROCONVERT_LICENSE environment variable (NonCommercial, SmallBusiness or the key). It is optional for the free licences and expected for commercial ones; nothing is enforced and nothing phones home.

AvroConvert.License = AvroLicense.NonCommercial;          // or AvroLicense.SmallBusiness
AvroConvert.License = AvroLicense.Commercial("AVC1.…");   // licence key received by e-mail after purchase

Details in LICENSE.md.

Versions 3.x stay under CC BY-NC-SA 3.0. A commercial licence bought for 4.x also covers the 3.4.x releases, so a team that is not on .NET 10 yet can be licensed now and upgrade later. If you bought a 3.x licence from Xabe, it still covers 3.x, and you can have a free perpetual licence for 4.x and every later version: send the invoice to contact@soltechnology.dev, there is no deadline (licenses/Commercial.md, section 12).

Contribution

We want to improve AvroConvert as much as possible. If you have any idea, found next possible feature, optimization opportunity or better way for integration, leave a comment or pull request.

Thank you a million to all the contributors to the library, including those that raise issues, started conversations, and those who send pull requests. Thank you!

These amazing people have contributed to AvroConvert:

<a href="https://github.com/AdrianStrugala/AvroConvert/graphs/contributors"> <img src="https://contrib.rocks/image?repo=AdrianStrugala/AvroConvert" /> </a>

  • alternate text is missing from this package README image – schema → C# model, Avro file viewer, JSON → Avro, schema compatibility checker, Kafka message decoder; runs in your browser
  • Nuget – Avro as the wire format between HTTP services: HttpClient, MVC and Minimal API
  • Nuget – Confluent Schema Registry serializers for plain .NET objects, interoperable with Java/Python/Go
  • Avro API article

Apache Avro, Avro and Apache are trademarks of The Apache Software Foundation. AvroConvert is an independent implementation of the Avro specification for .NET and is not affiliated with, endorsed by or sponsored by the ASF.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on AvroConvert:

Package Downloads
Memphis.Client

Memphis.Client SDK intended to make easy integration of Memphis into .NET projects

SolTechnology.Avro.Kafka

AvroConvert serializers for Confluent Kafka: plain .NET objects in the Confluent Schema Registry wire format, interoperable with the Confluent serializers of any language.

SolTechnology.Avro.Http

Apache Avro over HTTP with AvroConvert: HttpClient extensions, MVC formatters, Minimal API results and request bodies, and streaming of IAsyncEnumerable in both directions.

SolTechnology.Core.ApiClient

Resilient HTTP client wrapper with built-in Polly retry policies, exponential backoff, circuit breaker patterns, and Avro serialization support. Simplifies external API integration with production-ready resilience patterns.

OptimoveSdk.Engager.Integration

SDK for Engagers intergration with Optimove

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0-preview.2 32 10/25/2026
4.0.0-preview.1 48 10/24/2026
3.4.17 33,450 7/14/2026
3.4.16 290,381 9/18/2025
3.4.15 262,789 3/31/2025
3.4.14 149,167 3/19/2025
3.4.12 62,938 3/7/2025
3.4.11 40,959 3/6/2025
3.4.10 201,890 10/21/2024
3.4.9 192,976 9/18/2024
3.4.8 370,780 5/8/2024
3.4.7 44,257 4/26/2024 3.4.7 is deprecated because it has critical bugs.
3.4.6 85,079 3/4/2024
3.4.5 54,361 2/15/2024
3.4.4 86,391 1/16/2024
3.4.3 130,259 12/9/2023
3.4.2 49,025 12/1/2023
3.4.1 55,196 11/11/2023
3.4.0 78,805 9/18/2023
Loading failed

4.0: new licence (PolyForm Noncommercial / Small Business / Commercial), net10.0 only, compiled typed serializers (up to 20x faster deserialization), spec fixes. See docs/CHANGELOG.md.