Protobuf 뷰어

Protocol Buffers 바이너리 디코딩

Wire 유형 참조

0 - Varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum
1 - 64-bit: fixed64, sfixed64, double
2 - Length-delimited: string, bytes, embedded messages, packed repeated
5 - 32-bit: fixed32, sfixed32, float

참고사항

  • 스키마 없이 raw 디코딩 수행
  • 필드 이름은 스키마 없이 알 수 없음
  • 중첩 메시지는 bytes로 표시
  • ZigZag 인코딩된 signed 값 자동 표시

Protocol Buffers Guide

What is Protocol Buffers?

Protocol Buffers (protobuf) is Google's language-neutral, platform-neutral extensible mechanism for serializing structured data. It's smaller, faster, and simpler than XML or JSON, commonly used with gRPC.

Wire Format

Protobuf uses a compact binary format. Each field is encoded as a tag (field number + wire type) followed by the value.

Tag = (field_number << 3) | wire_type

Example: Field 1, string type = (1 << 3) | 2 = 0x0A

Encoding Examples

Varint (int32, int64, bool)

150 → 96 01 (0x9601)

Each byte uses 7 bits for data, MSB indicates continuation

String

"Hello" → 0A 05 48 65 6C 6C 6F

Tag (0A) + Length (05) + UTF-8 bytes

Signed Integer (ZigZag)

-1 → 01, -2 → 03, 1 → 02, 2 → 04

ZigZag encoding: (n << 1) ^ (n >> 31)

Getting Protobuf Data

# Capture gRPC traffic with grpcurl

grpcurl -plaintext -d '{"id": 1}' localhost:50051 myservice.MyMethod

# Encode with protoc

echo 'name: "test"' | protoc --encode=MyMessage message.proto | xxd -p

# Decode with protoc

cat data.bin | protoc --decode_raw

Related Tools

Developer Tools

개발자를 위한 80가지 이상의 무료 온라인 도구를 제공합니다. Base64, JSON, JWT, 정규식 등 필수 개발 도구를 한 곳에서.

Developer Tools © 2025. All rights reserved.

대부분의 도구는 브라우저에서 동작하며, 네트워크가 필요한 도구만 실행 시에 데이터가 전송됩니다.

Protocol Buffers Decoder - Protobuf Viewer | Developer Tools