Which programming languages does FlatBuffers support?
Updated
FlatBuffers supports C++, C#, C, Go, Java, Kotlin, JavaScript, Lobster, Lua, TypeScript, PHP, Python, Rust, and Swift. The official docs list a language-specific guide for each of these, so you can generate and read FlatBuffers data from any of them while keeping the same schema and binary format across platforms.
The full list of supported languages
According to the FlatBuffers documentation, the library is an efficient cross-platform serialization library for:
- C++
- C#
- C
- Go
- Java
- Kotlin
- JavaScript
- Lobster
- Lua
- TypeScript
- PHP
- Python
- Rust
- Swift
The docs also provide a dedicated language guide for each one, covering how to use the generated code in that language.
What "supported" means in practice
Support is not just a claim on a list. The workflow is:
- Define a schema in a
.fbsfile. - Run the
flatccompiler to generate code for your target language(s). - Use the generated code in your application to build and read buffers.
Because the same schema and binary format are used everywhere, a buffer written by, say, a C++ service can be read by a Go, Java, or Python client without a conversion step. That is the cross-platform serialization capability the docs describe.
Language guides in the docs
The documentation organizes language material under "Language Guides," with a page per language (C, C++, C#, Dart, Go, Java, JavaScript, Kotlin, Lobster, Lua, PHP, Python, Rust, Swift, TypeScript). Each guide is the place to check for the exact generated-code API and any language-specific setup.
Choosing a language for your project
The right choice depends on where the data is produced and consumed:
| Situation | Practical consideration |
|---|---|
| Performance-critical producer (e.g., a game engine or service) | C++ is the language FlatBuffers was originally created for at Google for game development and other performance-critical applications. |
| Mixed stack (e.g., C++ backend, web frontend) | Generate code for both languages from one schema; the buffer format stays the same. |
| Scripting or tooling around the data | Python, Lua, or PHP guides cover reading and writing from those environments. |
| Statically typed application code | FlatBuffers avoids the extra access code that dynamic-typing serialization systems like JSON tend to force on statically typed languages. |
If your language is not on the list, the docs do not claim support for it, so plan on one of the listed languages for reading and writing buffers.
Why the language list matters for your design
FlatBuffers' main advantage is that you access serialized data without parsing or unpacking, and the only memory needed to access your data is that of the buffer itself, with no heap required. That property holds across all supported languages, which is why the language list is broad rather than tied to one ecosystem. The schema can also evolve over time while maintaining forwards and backwards compatibility with old buffers, so adding a language to your stack later does not require rewriting existing data.
For setup steps in a specific language, start from that language's guide in the FlatBuffers docs, then use the flatc compiler page for generation options.