Swift vs Kotlin: source lines of code compared
The Swift vs Kotlin comparison on OctoCounts shows side-by-side source line counts for swiftlang/swift and JetBrains/kotlin, 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 swiftlang/swift and JetBrains/kotlin 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-24, swiftlang/swift contains 3,350,840 total lines (2,309,162 code) across 15,031 files, while JetBrains/kotlin contains 5,846,993 total lines (2,476,790 code) across 87,109 files as of 2026-11-24. swiftlang/swift and JetBrains/kotlin are similar in size 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 | swiftlang/swift | JetBrains/kotlin |
|---|---|---|
| Files | 15,031 | 87,109 |
| Total lines | 3,350,840 | 5,846,993 |
| Code lines | 2,309,162 | 2,476,790 |
| Comment lines | 699,437 | 2,592,320 |
| Blank lines | 342,241 | 777,883 |
| Languages counted | 33 | 37 |
Top languages in swiftlang/swift: C++ (39.2% of code), JSON (22.6% of code), Swift (18.2% of code). Top languages in JetBrains/kotlin: Kotlin (76.7% of code), Java (13.4% of code), Swift (2.4% of code). C++, JSON, Swift appear in both top language lists; C Header, Module-Definition appear only in swiftlang/swift's top languages; Kotlin, Java appear only in JetBrains/kotlin's top languages.
Methodology: both counts come from cached OctoCounts reports generated with tokei. swiftlang/swift was counted at ref main (commit 73278b73870f) on 2026-11-24; JetBrains/kotlin was counted at ref master (commit a8f6896a2d6b) on 2026-11-24. 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. swiftlang/swift: 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. JetBrains/kotlin: 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.
About this comparison
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: swiftlang/swift is the Swift repository — the compiler, standard library, and toolchain for the Swift programming language. JetBrains/kotlin is the Kotlin repository — the compiler and core language infrastructure for Kotlin. Both are language-toolchain repositories rather than libraries or applications, counted with the rules shown above, which makes this one of the more like-for-like comparisons on this site.
The per-language tables reflect each project's self-hosting trajectory: Swift's counted tree is a mix of C++ compiler code and an increasingly large Swift standard library, while Kotlin's counted tree is predominantly Kotlin with the runtime boundaries still maintained in other languages.
Language repository size does not measure language capability, compile speed, or runtime performance — those are properties of the shipped toolchain and the programs it compiles, not of the source tree's line count.
Sources: swiftlang/swift repository (compiler and standard library) · JetBrains/kotlin repository (compiler and core infrastructure). Statements verified 2026-09-16.
Evidence and next steps:
- swiftlang/swift SLOC report
- JetBrains/kotlin SLOC report
- Compare swiftlang/swift and JetBrains/kotlin interactively
- swiftlang/swift saved report
- JetBrains/kotlin saved report
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.
Compare FAQ
Which has more lines of code, swiftlang/swift or JetBrains/kotlin?
As of 2026-11-24, swiftlang/swift contains 3,350,840 total lines (2,309,162 code) across 15,031 files, while JetBrains/kotlin contains 5,846,993 total lines (2,476,790 code) across 87,109 files as of 2026-11-24. swiftlang/swift and JetBrains/kotlin are similar in size 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.
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 swiftlang/swift, JetBrains/kotlin, or any repository.
How is this comparison calculated?
Methodology: both counts come from cached OctoCounts reports generated with tokei. swiftlang/swift was counted at ref main (commit 73278b73870f) on 2026-11-24; JetBrains/kotlin was counted at ref master (commit a8f6896a2d6b) on 2026-11-24. 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.