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 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 rails/rails and sinatra/sinatra 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-16, rails/rails contains 321,476 total lines (144,543 code) across 1,894 files, while sinatra/sinatra contains 19,202 total lines (10,074 code) across 147 files as of 2026-11-09. rails/rails has about 14x the counted code lines of sinatra/sinatra 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.

Metricrails/railssinatra/sinatra
Files1,894147
Total lines321,47619,202
Code lines144,54310,074
Comment lines123,0515,745
Blank lines53,8823,383
Languages counted138

Top languages in rails/rails: Ruby (87.4% of code), JavaScript (8.1% 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 main (commit ed17c90871d2) on 2026-11-16; sinatra/sinatra was counted at ref c235249abaafa2780b540aca1813dfcf3d17c2dd (commit c235249abaaf) on 2026-11-09. 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. rails/rails: 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. sinatra/sinatra: 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: rails/rails is 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 is 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 contains 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) · sinatra/sinatra repository. 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.

Compare FAQ

Which has more lines of code, rails/rails or sinatra/sinatra?

As of 2026-11-16, rails/rails contains 321,476 total lines (144,543 code) across 1,894 files, while sinatra/sinatra contains 19,202 total lines (10,074 code) across 147 files as of 2026-11-09. rails/rails has about 14x the counted code lines of sinatra/sinatra 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 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 main (commit ed17c90871d2) on 2026-11-16; sinatra/sinatra was counted at ref c235249abaafa2780b540aca1813dfcf3d17c2dd (commit c235249abaaf) on 2026-11-09. 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.