# Ruby on Rails vs Sinatra: source lines of code compared

The Ruby on Rails vs Sinatra comparison on OctoCounts shows side-by-side source line counts for rails/rails and sinatra/sinatra, 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-17, rails/rails contains 305,333 total lines (138,140 code) across 1,866 files, while sinatra/sinatra contains 19,526 total lines (10,079 code) across 147 files as of 2026-08-26. rails/rails is about 14x the size of sinatra/sinatra by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [rails/rails](https://octocounts.com/github/rails/rails) | [sinatra/sinatra](https://octocounts.com/github/sinatra/sinatra) |
| --- | ---: | ---: |
| Files | 1,866 | 147 |
| Total lines | 305,333 | 19,526 |
| Code lines | 138,140 | 10,079 |
| Comment lines | 115,654 | 6,024 |
| Blank lines | 51,539 | 3,423 |
| Languages counted | 12 | 8 |

Top languages in rails/rails: Ruby (86.9% of code), JavaScript (8.5% of code), Rakefile (1.3% of code). Top languages in sinatra/sinatra: Ruby (95.7% of code), Rakefile (3.0% of code), Ruby HTML (0.6% of code). Ruby, Rakefile, Ruby HTML appear in both top language lists; JavaScript, Sass appear only in rails/rails's top languages; YAML, Haml appear only in sinatra/sinatra's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. rails/rails was counted at ref 6b52f384babca028b0e4e63651c2e634f123a2cd (commit 6b52f384babc) on 2026-09-17; sinatra/sinatra was counted at ref main (commit cb22afd7902b) on 2026-08-26. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

rails/rails counts the Ruby on Rails monorepo — the framework's component gems (railties, Active Record, Action Pack, and the rest of the stack) developed together in one repository. sinatra/sinatra counts the Sinatra repository: the small Ruby DSL for web applications, with most extensions and middleware living outside the counted tree. The comparison is full-stack monorepo vs minimal core, so the counts differ in scope by design.

Both repositories are Ruby codebases, per the per-language tables; the size gap is structural, since Rails's counted tree includes its ORM, mailer, job, and routing layers while Sinatra's core intentionally omits them.

Much of what a Rails application uses ships from the single counted repository, while comparable functionality for Sinatra lives in separate gems that are not part of either archive — the counts therefore cover unequal slices of each ecosystem.

_These numbers do not say which framework suits a project: the choice turns on how much structure an application wants, not on how many lines the framework's repository contains._

Sources: [rails/rails repository structure (framework monorepo)](https://github.com/rails/rails) · [sinatra/sinatra repository](https://github.com/sinatra/sinatra). Statements verified 2026-09-16.

Evidence and next steps:

- [rails/rails SLOC report](https://octocounts.com/github/rails/rails)
- [sinatra/sinatra SLOC report](https://octocounts.com/github/sinatra/sinatra)
- [Compare rails/rails and sinatra/sinatra interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Frails%2Frails&right=https%3A%2F%2Fgithub.com%2Fsinatra%2Fsinatra)

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, rails/rails or sinatra/sinatra?

rails/rails has more code: 138,140 code lines versus 10,079 for sinatra/sinatra, about 14x as much, based on cached OctoCounts reports as of 2026-09-17.

### 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 rails/rails, sinatra/sinatra, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. rails/rails was counted at ref 6b52f384babca028b0e4e63651c2e634f123a2cd (commit 6b52f384babc) on 2026-09-17; sinatra/sinatra was counted at ref main (commit cb22afd7902b) 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)
