Ratio Allocation Calculator

Split a total across multiple ratios, adjusting remainder units so the allocations sum to the total. Set the decimal places, then copy or save TXT and JSON.

How to use

  1. Enter the total to split and the ratio list.
  2. Choose the output decimal places and allocate.
  3. Review each share and rounding effects, then copy or save the result.

Allocation inputs

Use plain nonnegative numbers for total and ratios: up to 12 fractional digits, 64 characters each and 10^18. Separate 2–1,000 ratios with spaces, tabs or line breaks. At least one must be greater than zero. Signs, exponents and commas are not supported.

Choose 0–12 decimal places. The total must be exactly representable at that precision. Ratio input: 100,000 UTF-8 bytes. TXT/JSON: 250,000 bytes each. Inputs and results are neither stored nor sent.

Results

Try a use case and check the result

Allocate by weights while distributing rounding remainders so the displayed shares add up to the original total.

Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.

Allocate 10 in equal weights at two decimal places

Input and settings

Total: 10 / Weights: 1 1 1 / Decimal places: 2

Expected result

3.34 / 3.33 / 3.33
Sum: 10.00 / The first tied share receives the extra unit

Give a zero-weight item no allocation

Input and settings

Total: 100 / Weights: 0 1 3 / Decimal places: 0

Expected result

0 / 25 / 75
Sum: 100

How to read the result

Each quota is first floored at the chosen precision, then remaining smallest units go to the largest remainders. Input order breaks ties, so the first share gets 0.01 extra in the first example. Unlike independently rounding equal shares, the displayed sum matches the original total.

Scope and limits

Use 2–1000 non-negative weights separated by whitespace; all-zero weights are invalid. Precision is 0–12 decimal places. A total that cannot be represented at that precision is rejected rather than rounded. Weight input is limited to 100,000 bytes; each number to 64 characters, 12 fractional digits and magnitude 10¹⁸. Taxes, fees and the suitability of the weights are not assessed.

Verification: existing calculate checks cover largest remainders, input-order ties, zero weight, exact total preservation and rejection of a total incompatible with the chosen precision. JSON and saved results are compared.

Continue with the next task

Details and limits

Divide the total proportionally by the sum of ratios. The example total 100 and ratios 2, 3, 5 yields 20.00, 30.00 and 50.00. Zero ratios receive zero allocations.

First floor each allocation to the selected decimal unit. Distribute the remaining units one at a time to the largest division remainders. Equal remainders are prioritized in input order. This is the largest remainder method.

For total 10, ratios 1, 1, 1 and two decimal places, allocations are 3.34, 3.33 and 3.33, summing to 10.00. The first item gets the extra 0.01 because tied remainders use input order. Reordering items can change which receives an extra unit.

The total is never rounded. For example, 10.005 at two decimal places is an error; choose three or more places. Zero places uses integer units, two uses 0.01, and twelve uses 0.000000000001.

Totals and decimal ratios must be nonnegative. Negative numbers, exponents, percent signs and colon-separated ratios are unsupported. Ratios are weights and need not sum to 100. All-zero ratios are an error even for a zero total.

Internal arithmetic uses integers without floating-point rounding. TXT contains total, decimal places, every ratio allocation and their sum. JSON also records the largest remainder method, input-order tie priority and whether each allocation received an extra unit. Numeric values remain strings and all rows are exported. Files are UTF-8 without a BOM or added trailing newline.

Editing inputs or decimal places cancels work and clears old output. Cancel keeps inputs. Reset clears total, ratios and results, keeping the selected decimal places.

Frequently asked questions

Which item gets the remainder?

After flooring to the selected unit, extra units go to the largest remainders. Ties use input order.

Can ratios be zero or decimals?

Yes. Zero ratios receive zero. At least one ratio must be greater than zero. Input fractions allow up to 12 digits.

Will the allocations sum exactly to the total?

Yes, after a successful calculation. If the selected decimal places cannot represent the original total, the tool reports an error instead of rounding it.

Related tools

Inputs and storage

Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16