Repolode
google

google/flatbuffers

A cross-platform serialization library that lets you read binary data directly without parsing or unpacking it first.

Open-source alternative to:Protocol Buffers

Stars
26,567
Forks
3,712
Open issues
333
Last commit
5 hours ago

What is it?

FlatBuffers is a serialization library designed for memory efficiency. Data is stored in a binary buffer that can be accessed in place, so applications read fields directly from the serialized bytes instead of first deserializing them into objects. It also keeps forward and backward compatibility as schemas evolve.

You describe your data in a schema file (.fbs), then run the flatc compiler to generate accessor code for the languages you use. The repository includes runtime libraries and code generation for C, C++, C#, Dart, Go, Java, JavaScript, Kotlin, Lua, PHP, Python, Rust, Swift, TypeScript and more.

The library supports Windows, macOS, Linux and Android, and works on any platform with a recent C++ compiler (C++11 or newer).

Key features

  • 01Access serialized data directly without a parsing or unpacking step.
  • 02Generates accessor code for many languages from a single schema.
  • 03Supports forward and backward compatibility across schema versions.
  • 04Works across Windows, macOS, Linux and Android.

Use cases

  • Passing data between services or components written in different languages.
  • Storing binary data where fast, allocation-free reads matter, such as games or embedded systems.
  • Reading large serialized files via memory mapping without loading them fully.

Quick start

  1. 1

    Configure the build for flatc with CMake

    cmake -G "Unix Makefiles"
  2. 2

    Compile the flatc compiler

    make -j
  3. 3

    Write your schema (.fbs); see samples/monster.fbs for an example

  4. 4

    Generate code for your languages from the schema

    ./flatc --cpp --rust monster.fbs

Things to know

  • The flatc compiler has no package-manager install in the README and must be built from source with CMake and a C++ compiler.

Topics

FAQ

What is flatbuffers?
A cross-platform serialization library that lets you read binary data directly without parsing or unpacking it first. FlatBuffers is a serialization library designed for memory efficiency. Data is stored in a binary buffer that can be accessed in place, so applications read fields directly from the serialized bytes instead of first deserializing them into objects. It also keeps forward and backward compatibility as schemas evolve.
Is flatbuffers free to use? What license does it have?
flatbuffers is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is flatbuffers still maintained?
Actively maintained. The last commit to flatbuffers was on Oct 21, 2026.
What can I use flatbuffers for?
Passing data between services or components written in different languages. Storing binary data where fast, allocation-free reads matter, such as games or embedded systems. Reading large serialized files via memory mapping without loading them fully.
How do I install flatbuffers?
Configure the build for flatc with CMake: cmake -G "Unix Makefiles" Compile the flatc compiler: make -j Write your schema (.fbs); see samples/monster.fbs for an example Generate code for your languages from the schema: ./flatc --cpp --rust monster.fbs
Where can I get flatbuffers?
The source code and installation instructions are on GitHub: https://github.com/google/flatbuffers

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects