A blazing fast JSON parser and generator implemented in pure Elixir.
Jason is a high-performance JSON parsing and generation library written in pure Elixir. It solves the need for fast, reliable JSON handling in Elixir applications, offering significant speed improvements over existing alternatives while maintaining strict compliance with JSON standards. The library is designed as a drop-in replacement for libraries like Poison, with better performance and more rigorous specification adherence.
Elixir developers building web APIs, data processing pipelines, or any application requiring efficient JSON serialization/deserialization. It's particularly valuable for projects using Phoenix, Ecto, Absinthe, or Postgrex where JSON performance is critical.
Developers choose Jason for its exceptional performance (often 2x faster than pure-Elixir alternatives), strict standards compliance, and seamless integration with major Elixir ecosystems like Phoenix and Ecto. Its pure-Elixir implementation avoids NIF-related safety concerns while delivering performance comparable to C-based solutions.
A blazing fast JSON parser and generator in pure Elixir.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show it's at least twice as fast as pure Elixir libraries like Poison and comparable to C-based NIF implementations such as jiffy, making it ideal for high-throughput applications.
Fully conforms to RFC 8259 and ECMA 404, validated with JSONTestSuite, ensuring reliable and spec-compliant JSON parsing and generation without edge-case errors.
Written entirely in Elixir with no external NIF dependencies, avoiding potential crashes and compatibility issues across Erlang/OTP versions.
Requires explicit implementation of the `Jason.Encoder` protocol for structs, promoting intentional serialization and preventing accidental data leakage.
Supports `Jason.Fragment` for injecting pre-encoded JSON, eliminating unnecessary decode/encode roundtrips and improving performance in caching or database integration scenarios.
Unlike Poison, Jason does not automatically encode arbitrary structs; each requires manual `Jason.Encoder` implementation, adding development overhead for dynamic or legacy codebases.
Missing out-of-the-box encoders for common Elixir types like `MapSet`, `Range`, and `Stream`, forcing custom implementations that can be error-prone.
Lacks Poison's `as:` option for decoding JSON into specific structs or shapes, requiring additional manual mapping steps that complicate data handling.
Adheres rigidly to JSON standards, rejecting non-compliant inputs like unescaped newlines, which might disrupt integrations with systems using more lenient libraries.
jason is an open-source alternative to the following products:
Poison is an Elixir library that provides a fast, pure Elixir JSON parser and generator, commonly used for encoding and decoding JSON data in Elixir applications.
jiffy is a JSON Web Token library for Elixir that provides a simple API for encoding and decoding JWT tokens with support for various algorithms.