# 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 with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-13, swiftlang/swift contains 3,073,988 total lines (2,131,342 code) across 12,504 files, while JetBrains/kotlin contains 5,653,114 total lines (2,451,017 code) across 82,973 files as of 2026-08-26. swiftlang/swift and JetBrains/kotlin are similar in size by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [swiftlang/swift](https://octocounts.com/github/swiftlang/swift) | [JetBrains/kotlin](https://octocounts.com/github/JetBrains/kotlin) |
| --- | ---: | ---: |
| Files | 12,504 | 82,973 |
| Total lines | 3,073,988 | 5,653,114 |
| Code lines | 2,131,342 | 2,451,017 |
| Comment lines | 631,977 | 2,454,437 |
| Blank lines | 310,669 | 747,660 |
| Languages counted | 12 | 12 |

Top languages in swiftlang/swift: C++ (39.2% of code), JSON (24.4% of code), Swift (16.3% of code). Top languages in JetBrains/kotlin: Kotlin (75.9% of code), Java (14.3% of code), JSON (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 0a93b4f984f4602abb4404e4333b481190b9d61e (commit 0a93b4f984f4) on 2026-09-13; JetBrains/kotlin was counted at ref master (commit 3a578d6e27ad) on 2026-08-26. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

swiftlang/swift counts the Swift repository — the compiler, standard library, and toolchain for the Swift programming language. JetBrains/kotlin counts the Kotlin repository — the compiler and core language infrastructure for Kotlin. Both are language-toolchain repositories rather than libraries or applications, counted with the same engine on the dates 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.

Both repositories include their compiler test suites and standard-library validation material, so a significant share of each count exists to keep the language correct rather than to ship as tool code.

_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)](https://github.com/swiftlang/swift) · [JetBrains/kotlin repository (compiler and core infrastructure)](https://github.com/JetBrains/kotlin). Statements verified 2026-09-16.

Evidence and next steps:

- [swiftlang/swift SLOC report](https://octocounts.com/github/swiftlang/swift)
- [JetBrains/kotlin SLOC report](https://octocounts.com/github/JetBrains/kotlin)
- [Compare swiftlang/swift and JetBrains/kotlin interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fswiftlang%2Fswift&right=https%3A%2F%2Fgithub.com%2FJetBrains%2Fkotlin)

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-09-13, swiftlang/swift and JetBrains/kotlin are close in size: 2,131,342 vs 2,451,017 code lines, a difference of less than 15%. Neither clearly outsizes the other by this metric.

### 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 0a93b4f984f4602abb4404e4333b481190b9d61e (commit 0a93b4f984f4) on 2026-09-13; JetBrains/kotlin was counted at ref master (commit 3a578d6e27ad) 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.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
