Fastjson2 is a high-performance JSON library for Java designed as the next-generation successor to Fastjson, optimized for parsing and serializing JSON data with significantly faster performance than competing libraries.
The library addresses the need for efficient JSON processing by implementing optimized parsing and serialization algorithms. It supports both JSON text format and JSONB, a binary protocol, allowing developers to choose the format best suited to their use case. The tool provides full document parsing capabilities as well as selective extraction through JSONPath queries compatible with SQL:2016 syntax, enabling efficient data retrieval without parsing entire documents.
Fastjson2 suits projects requiring high-throughput JSON processing across diverse environments. It is optimized for modern Java versions including JDK 8, 11, 17, and 21, with specific support for compact strings, Records, and Vector API features. The library runs on Java servers, Android 8 and later, and big data platforms. It includes first-class Kotlin support with idiomatic extensions and DSL-style APIs for Kotlin projects. The tool provides built-in JSON Schema validation and is compatible with GraalVM Native Image compilation. Security is prioritized with AutoType disabled by default and no hardcoded whitelists. A compatibility module exists for migration from Fastjson 1.x, though complete compatibility is not guaranteed and testing is recommended.
The project maintains active development with regular updates addressing performance optimization and feature expansion. The codebase demonstrates sustained engineering effort focused on supporting multiple Java versions and platforms. Documentation is comprehensive, covering quick start guides, advanced usage patterns, and migration paths from earlier versions. The project accepts community contributions and maintains an issue tracker for bug reports and feature requests.