The nlohmann/json vs RapidJSON comparison on OctoCounts shows side-by-side source line counts for nlohmann/json and Tencent/rapidjson, counted under the rules and on the dates stated below: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.
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-11-15, nlohmann/json contains 129,774 total lines (89,569 code) across 140 files, while Tencent/rapidjson contains 28,889 total lines (21,118 code) across 150 files as of 2026-11-03. nlohmann/json has about 4.2x the counted code lines of Tencent/rapidjson under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.
| Metric | nlohmann/json | Tencent/rapidjson |
|---|---|---|
| Files | 140 | 150 |
| Total lines | 129,774 | 28,889 |
| Code lines | 89,569 | 21,118 |
| Comment lines | 27,880 | 4,578 |
| Blank lines | 12,325 | 3,193 |
| Languages counted | 15 | 12 |
Top languages in nlohmann/json: C++ Header (96.4% of code), CMake (1.8% of code), Python (0.9% 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, Meson, Makefile 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 develop (commit abbc29963a3f) on 2026-11-15; Tencent/rapidjson was counted at ref master (commit 297637bc0a0f) on 2026-11-03. See the counting methodology for ignored directories and analysis options.
Both reports use the same engine and effective counting rules. Repository declarations, when enabled, are specific to each repository. nlohmann/json: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed. Tencent/rapidjson: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.
Background observations recorded on 2026-09-16; language descriptions here are historical context, not claims about the current filtered shares. Use this page's measured language breakdown for current counts. Repository layout before counting filters: nlohmann/json is the nlohmann/json repository: a C++ JSON library best known for its single-header distribution, with the generating source, tests, documentation, and benchmarks in the same tree. Tencent/rapidjson is the RapidJSON repository: a multi-header C++ JSON library with its own test suite and benchmarks. Both are header-oriented C++ libraries, counted on the dates shown above.
Both counted archives are overwhelmingly C++ in the per-language table, so this is a like-for-like language comparison; the totals differ mainly in how each project organizes and regenerates its headers.
nlohmann/json's repository contains the amalgamation tooling that produces its single-header release artifact, while RapidJSON ships an include/ tree of separate headers — two different repo shapes for the same library category, both visible in the file layout of each report.
Header-library line counts do not track parsing speed, binary size, or compile-time cost in your build; benchmarks and your own measurements are the right tool for that, not these totals.
Sources: nlohmann/json repository (single-header C++ JSON library) · Tencent/rapidjson repository (multi-header C++ JSON library). Statements verified 2026-09-16.
Evidence and next steps:
Saved reports remain subject to cache cleanup and replacement. Export their JSON for durable citation; live report URLs can change.
Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.
As of 2026-11-15, nlohmann/json contains 129,774 total lines (89,569 code) across 140 files, while Tencent/rapidjson contains 28,889 total lines (21,118 code) across 150 files as of 2026-11-03. nlohmann/json has about 4.2x the counted code lines of Tencent/rapidjson under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.
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.
Methodology: both counts come from cached OctoCounts reports generated with tokei. nlohmann/json was counted at ref develop (commit abbc29963a3f) on 2026-11-15; Tencent/rapidjson was counted at ref master (commit 297637bc0a0f) on 2026-11-03. See the counting methodology for ignored directories and analysis options.
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.