nlohmann/json vs RapidJSON: source lines of code compared

This page compares the source lines of code (SLOC) of nlohmann/json and Tencent/rapidjson using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.

As of 2026-09-08, nlohmann/json contains 63,626 total lines (40,672 code) across 94 files, while Tencent/rapidjson contains 28,889 total lines (21,118 code) across 150 files as of 2026-08-26. nlohmann/json is about 1.9x the size of Tencent/rapidjson by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricnlohmann/jsonTencent/rapidjson
Files94150
Total lines63,62628,889
Code lines40,67221,118
Comment lines15,3104,578
Blank lines7,6443,193
Languages counted1212

Top languages in nlohmann/json: C++ Header (94.2% of code), CMake (3.3% of code), Python (1.4% of code). Top languages in Tencent/rapidjson: C Header (61.5% of code), JSON (26.7% of code), C++ (9.5% of code). CMake appears in both top language lists; C++ Header, Python, Makefile, Bazel appear only in nlohmann/json's top languages; C Header, JSON, C++, YAML appear only in Tencent/rapidjson's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. nlohmann/json was counted at ref 7b2d73cf2e443adbe7903754f912ed95b42504f1 (commit 7b2d73cf2e44) on 2026-09-08; Tencent/rapidjson was counted at ref master (commit 24b5e7a8b27f) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

Evidence and next steps:

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

Compare FAQ

Which has more lines of code, nlohmann/json or Tencent/rapidjson?

nlohmann/json has more code: 40,672 code lines versus 21,118 for Tencent/rapidjson, about 1.9x as much, based on cached OctoCounts reports as of 2026-09-08.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for nlohmann/json, Tencent/rapidjson, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. nlohmann/json was counted at ref 7b2d73cf2e443adbe7903754f912ed95b42504f1 (commit 7b2d73cf2e44) on 2026-09-08; Tencent/rapidjson was counted at ref master (commit 24b5e7a8b27f) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.