English | Bahasa Indonesia
Electoral math, simplified.
ApportionmentCalc is a single-file, browser-based calculator for comparing two popular electoral seat allocation methods: Sainte-Laguë and Hare Quota. Designed for students, researchers, election observers, and anyone curious about proportional representation, this tool visualizes how different methods can produce different outcomes from the same vote counts.
The interface supports both English and Bahasa Indonesia.
The calculator takes vote counts for multiple political parties and a total number of seats to allocate, then:
- Electoral Threshold: Filters out parties that do not meet the minimum vote percentage requirement (if configured).
- Hare Quota Method: Calculates the Electoral Quota, allocates seats based on full quotas, then distributes remaining seats to parties with the largest remainders.
- Sainte-Laguë Method: Uses a divisor sequence (1, 3, 5, 7, 9...) to iteratively allocate seats based on the highest quotient at each step.
- Comparison View: Shows side-by-side results and highlights differences between the two methods.
- Download
ApportionmentCalc.html. - Open it in any modern browser (Chrome, Edge, Firefox, Safari).
- Enter the total number of seats available.
- Set the electoral threshold (e.g., 4%).
- Add political parties with their vote counts.
- Click "Calculate Allocation".
- Compare the results, view step-by-step visualizations, or export data to CSV.
- Multi-language Support: Toggle between English and Indonesian.
- Dark/Light Theme: Automatic or manual theme selection.
- Electoral Threshold: Configurable percentage to filter parties.
- Dual-method comparison: See Hare Quota and Sainte-Laguë results side-by-side.
- Dynamic party input: Add or remove as many parties as needed.
- Detailed breakdown: View Quota, remainders, quotients, and detailed allocation steps (limited to 50 rounds for detailed view).
- Visualizations: Step-by-step table showing how each seat is awarded in the Sainte-Laguë method.
- CSV Import/Export: Import party data from CSV/TSV files and download results for further analysis.
- Single HTML file: No installation, no dependencies, works completely offline.
- Responsive design: Works on desktop, tablet, and mobile devices.
- Civic education: Teaching students about proportional representation.
- Election analysis: Comparing actual results with alternative methods.
- Research: Studying the mathematical properties of allocation formulas.
- Policy discussion: Evaluating electoral system reforms.
- Calculates a quota: Total Valid Votes ÷ Total Seats = Quota
- Each party gets one seat for each full quota
- Remaining seats go to parties with the largest remainders
- Tends to favor smaller parties
- Uses odd-number divisors: 1, 3, 5, 7, 9...
- Seats allocated one-by-one to the party with the highest quotient
- Formula: Votes ÷ (2 × Current Seats + 1)
- Tends to favor larger parties
A statistical simulation of ~1 million electoral scenarios confirmed the bias tendencies of each method. Parties were classified by vote share: Small (<5%), Medium (5-15%), and Large (>15%).
- Small Parties: Hare Quota provided a more favorable outcome in 57.02% of cases, compared to 4.51% for Sainte-Laguë.
- Large Parties: Sainte-Laguë provided a more favorable outcome in 54.50% of cases, compared to 6.45% for Hare Quota.
- Proportionality: On average, the Hare Quota method resulted in a slightly lower Gallagher Index (4.21 vs 4.64), indicating it is marginally more proportional across the simulated scenarios.
This data supports the general consensus that Hare Quota is friendlier to smaller parties, while Sainte-Laguë significantly benefits larger parties.
All calculations happen locally in your browser. No data is sent to any server. The tool is completely offline once loaded.
MIT License. See LICENSE for details.
Contributions, issues, and suggestions are welcome. Please open an issue to discuss ideas or submit a PR.