Decrement Integers
Subtract a fixed value or percentage from each integer in a batch. BigInt support for huge numbers, filters, accurate math. Free, offline, client-side, instant, secure.
Subtract a fixed value or a percentage from every integer in a batch. BigInt support for huge numbers (above 2⁵³). Three filter modes.
How to Use Decrement Integers
- Paste integers (one per line, or comma/semicolon-separated). Both positive and negative integers OK.
- Pick Fixed value mode (subtract a constant) or Percentage mode (subtract
n × pct/100). Examples: fixed 5 → every integer minus 5; percentage 10 → every integer minus 10% of itself (100 → 90). - Choose a filter: all, positive only, or negative only. Filtered-out integers are simply omitted from output.
- Pick output separator (newline / comma / space).
- Load a sample
- Use Ctrl+Enter to recalculate. Live preview after 200 ms.
Frequently Asked Questions
Fixed vs Percentage – examples
Fixed mode, dec=5: integers are reduced by 5. 10 → 5, −3 → −8, 0 → −5. The decrement value is the same absolute amount applied to every integer.
Why does percentage on a negative number make it LESS negative?
Because percentage means “subtract this fraction of yourself”. For −100 at 10%: 10% of −100 = −10. Subtracting that: −100 − (−10) = −90. Move toward zero by 10%. This is consistent with how financial systems calculate “10% reduction” (smaller absolute value), even on negative balances. If you want the opposite (more-negative), use a negative percentage: dec = −10 in percentage mode would give −100 → −110.
What about BigInt for huge numbers?
JavaScript’s native Number type loses precision above 2⁵³−1 ≈ 9.007 × 10¹⁵. Past that, integers can’t be exactly represented – `9007199254740993` rounds to `9007199254740992`. This version detects 16+ digit inputs and switches to BigInt math. Try the “BigInt demo” sample (21-digit numbers) to see exact precision preserved. Hint chip indicates when BigInt is active. Browser support: Chrome 67+, Safari 14+, Firefox 68+.
How does BigInt percentage math work?
BigInt only supports integer arithmetic, so we use fixed-point: multiply percentage by 10⁹, multiply by the BigInt value, then divide back by 10¹¹ (with proper rounding). This preserves 9 decimals of precision in the percentage. For exact math without rounding, use fixed mode instead.
What if I want a fractional decrement value?
Use percentage mode (which supports floats) instead of fixed mode (which is integer-only by design). For example, to subtract 0.5 from every integer… actually you can’t – by definition integers are whole numbers, so subtracting 0.5 produces fractions. If you need fractional output, use a different tool (decimal/float math) – this one preserves integer-ness.
What do the filter modes do?
All: every integer is decremented. Positive only: only integers > 0 are decremented; negatives and zero are EXCLUDED from output (not passed through unchanged). Negative only: only integers < 0 are decremented; positives and zero excluded. Useful for selective batch operations – e.g., reduce all positive prices by 10% while leaving negative (refunded) balances alone.
What happens to integers that don’t match the filter?
They’re omitted from the output entirely (not passed through with original value). If you need pass-through behavior, run the tool twice with opposite filters and merge results, or use a programming approach. The current behavior matches the “subset processing” use case where filtered output is a strict subset of inputs.
Are negative decrement values supported?
Yes. Negative decrement = ADD (math is symmetric). So dec=−5 in fixed mode is equivalent to incrementing by 5. The companion tool “Increment Integers” is more direct (avoids the cognitive overhead of a negative value in a tool labelled “decrement”), but for symmetric calculations the inverse works fine here.
Is my data secure?
Yes. Integer math runs entirely in your browser using native Number / BigInt arithmetic. Your data never leaves your device.