title: Overview sidebar_position: 1 id: index license: | Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Fory JSON is Apache Fory's thread-safe JSON codec for Java, Kotlin, and Scala. It provides interpreted and generated codecs for Java objects, records, immutable creator-based classes, common JDK types, generic containers, Kotlin models and semantic types, Scala models and collections, 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

GoalPage
First runnable JSON round tripGetting Started
Understand Java object mapping and configurationObject Mapping
Configure properties, creators, values, validators, and mixinsAnnotations
Extend complete values, children, and map keysCustom Codecs
Package and distribute reusable JSON extensionsModules
Use data classes, Kotlin nullability, defaults, and value typesKotlin
Use case classes, Scala collections, and Scala enumsScala
Deploy on AndroidAndroid
Build a GraalVM native imageGraalVM Native Image
Decode input safelySecurity
Diagnose failuresTroubleshooting

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.

Java JSON String benchmark throughput

Java JSON UTF-8 bytes benchmark throughput

RepresentationOperationfory-json ops/secjackson ops/secgson ops/sec
StringSerialize7,387,4652,049,3681,084,042
StringDeserialize2,897,9551,074,885902,772
UTF-8 bytesSerialize10,375,4981,868,6141,037,211
UTF-8 bytesDeserialize3,077,1581,268,397933,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.