NOTE: This site is deprecated. The site will be turned down after January 31, 2023, and traffic will redirect to the new site at In the meantime, updates will be made only to
Stay organized with collections Save and categorize content based on your preferences.
message Person {
  optional string name = 1;
  optional int32 id = 2;
  optional string email = 3;

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.
Person john = Person.newBuilder()
    .setName("John Doe")
output = new FileOutputStream(args[0]);
Protocol buffers currently support generated code in Java, Python, Objective-C, and C++. With our new proto3 language version, you can also work with Kotlin, Dart, Go, Ruby, and C#, with more languages to come.
Person john;
fstream input(argv[1],
    ios::in | ios::binary);
id =;
name =;
email =;
  1. Download and install the protocol buffer compiler.
  2. Read the overview.
  3. Try the tutorial for your chosen language.