Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C
  3. mpack

mpack

MITCv1.1.1

A simple, secure, and lightweight C implementation of the MessagePack serialization format, suitable for embedded systems.

GitHubGitHub
625 stars100 forks0 contributors

What is mpack?

MPack is a C implementation of the MessagePack serialization format, providing encoder and decoder functionality for efficient binary data interchange. It solves the performance and size limitations of JSON by offering a compact, fast, and secure alternative for applications like embedded systems, games, and network communication. The library includes features like tree parsing, incremental reading, and customizable builds to fit various constraints.

Target Audience

C developers working on embedded systems, IoT devices, mobile applications, or any project requiring high-performance, low-footprint serialization with security against untrusted data.

Value Proposition

Developers choose MPack for its combination of simplicity, security, and speed in a lightweight package, along with extensive platform support and no external dependencies, making it a robust alternative to larger or less secure serialization libraries.

Overview

MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C]

Use Cases

Best For

  • Embedded systems and microcontrollers requiring minimal memory usage
  • High-performance applications where JSON parsing is too slow
  • Secure handling of untrusted serialized data from networks
  • Cross-platform projects targeting desktops, smartphones, and WebAssembly
  • Linux kernel modules needing in-kernel serialization
  • Games and real-time applications with strict performance requirements

Not Ideal For

  • Projects requiring JSON serialization without additional conversion layers
  • Teams working in multiple programming languages needing a unified serialization library with broad bindings
  • Applications that prioritize human-readable data formats for easy debugging or configuration
  • Environments where easy installation via package managers is preferred over embedding source code

Pros & Cons

Pros

High Performance

Benchmarks show MPack outperforms many JSON and MessagePack libraries, with some tests being several times faster than RapidJSON, making it ideal for speed-critical applications.

Security-First Design

Built-in protection against malicious or malformed input data, with stateful error handling that returns safe defaults like nil values, ensuring robust handling of untrusted sources.

Embedded Optimization

Minimal footprint and no libc requirement, allowing it to run on microcontrollers like Arduino and in the Linux kernel, with configurable features to reduce code size.

Flexible I/O Support

Supports memory buffers, files, and custom flush functions, with options for both tree-style and incremental parsing to adapt to different performance and memory constraints.

Cons

C-Language Lock-In

MPack is implemented solely in C and lacks official bindings for other languages, limiting its use in multi-language ecosystems without additional integration work.

Compile-Time Configuration Overhead

Customizing features at compile-time requires manual setup, such as downloading the amalgamation package or adjusting build flags, which can be more complex than using runtime-configurable libraries.

Limited Format Support

Strictly supports MessagePack; it does not include native JSON or other serialization formats, so interoperability with JSON-centric systems necessitates custom conversion code.

Frequently Asked Questions

Quick Stats

Stars625
Forks100
Contributors0
Open Issues12
Last commit1 month ago
CreatedSince 2015

Tags

#c-library#msgpack#embedded#binary-encoding#c#data-interchange#serialization#cross-platform#messagepack#performance

Built With

C
C++

Included in

C3.8k
Auto-fetched 11 hours ago

Related Projects

protobuf-cprotobuf-c

Protocol Buffers implementation in C

Stars2,977
Forks769
Last commit1 year ago
binnbinn

Binary Serialization

Stars481
Forks62
Last commit11 months ago
cmpcmp

An implementation of the MessagePack serialization format in C / msgpack.org[C]

Stars367
Forks84
Last commit11 months ago
netstring-cnetstring-c

Netstring for C

Stars8
Forks1
Last commit5 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub