Overview
Fory JSON is Apache Fory's thread-safe Java JSON codec. It provides interpreted and runtime-generated codecs for Java objects, records, immutable creator-based classes, common JDK types, generic containers, and custom complete-value codecs.
Fory JSON is a separate data format from Fory's binary native and xlang protocols. Use it when a system must exchange ordinary JSON with browsers, APIs, logs, configuration, or another JSON implementation. Use the Fory binary protocol when you need cross-language schema metadata, reference identity, circular graphs, or Fory's binary-only features.
Documentation map
| Goal | Page |
|---|---|
| First runnable JSON round trip | Getting Started |
| Understand Java object mapping and configuration | Object Mapping |
| Configure properties, creators, values, validators, and mixins | Annotations |
| Extend complete values, children, and map keys | Custom Codecs |
| Deploy on Android | Android |
| Build a GraalVM native image | GraalVM Native Image |
| Decode input safely | Security |
| Diagnose failures | Troubleshooting |
Performance
The Java JSON benchmark compares fory-json, Jackson, and Gson with the same data. Results below are single-threaded throughput measurements on an Apple M4 Pro with JDK 26.0.1; higher is better. See the complete benchmark report for the command, environment, and measurement configuration.


| Representation | Operation | fory-json ops/sec | jackson ops/sec | gson ops/sec |
|---|---|---|---|---|
| String | Serialize | 7,387,465 | 2,049,368 | 1,084,042 |
| String | Deserialize | 2,897,955 | 1,074,885 | 902,772 |
| UTF-8 bytes | Serialize | 10,375,498 | 1,868,614 | 1,037,211 |
| UTF-8 bytes | Deserialize | 3,077,158 | 1,268,397 | 933,079 |
Related Java guides
For binary serialization, start with Java Object Serialization and choose xlang or native. Binary builder options are documented separately in Java Configuration.