Integer Digit Error Introducer

Iterates every individual digit across every integer in a list and independently mutates each one to a random different digit at a chosen percentage rate, leaving the sign character untouched; a seeded PRNG means the same input, rate, and seed always reproduce identical output, making this useful as controlled corruption for testing parsers. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

This tool corrupts a list of integers at the digit level: every digit of every value is independently a candidate for mutation, rolled at a percentage rate you choose.

It's built for controlled corruption of test data, not open-ended fuzzing: you dial in exactly how aggressive the corruption should be, and a seeded PRNG guarantees the same input always produces the same corrupted output.

What Is Integer Digit Error Introducer?

A digit-level corruption tool for lists of integers, one value per line, where each individual digit character (not each line) is an independent mutation candidate.

At the chosen rate, a digit is replaced with a different, randomly chosen digit 0-9; digits that aren't selected pass through unchanged, and the sign character is always left alone.

How Integer Digit Error Introducer Works

The list is parsed and validated first; every non-blank line must be a plain integer, or the tool reports which line failed.

A mulberry32 pseudo-random generator is seeded from your chosen seed value. For every digit of every integer, the generator draws a number; if it falls under the digit error rate, that digit is replaced with a different digit.

The replacement digit is chosen so it's always different from the original (an offset of 1-9 added mod 10), and the sign character, if any, is carried through untouched since digit iteration only ever looks at the numeric digits.

When To Use Integer Digit Error Introducer

Use it to generate integer test fixtures with a precisely controlled amount of digit-level noise, for testing how a parser or validator degrades as corruption increases.

It's also a good way to compare a validator's tolerance across error rates: run the same list at 5%, 20%, and 50% and see where it starts failing.

Features

Advantages

  • The digit error rate gives fine, continuous control over how much of the list gets corrupted, rather than an all-or-nothing per-line choice.
  • Fully deterministic and reproducible given the same input, rate, and seed.
  • Sign characters are guaranteed untouched, so corruption never accidentally flips a value's sign.

Limitations

  • Mutated integers can end up with leading zeros (e.g. 123 becoming 023), since digit-level mutation intentionally doesn't renormalize the result afterward.
  • Only understands plain decimal integers, one per line; it has no notion of floating-point values or other numeric formats.
  • A rate near 100% can occasionally leave a short integer completely unrecognizable from its original value, which is expected but worth being aware of when picking a rate.

Examples

50% digit error rate with a fixed seed

Input

123
-4560
789

Output

223
-4010
989

At a 50% rate and seed 7, roughly half the digits across the three values were independently mutated; the sign on -4560 was preserved.

0% rate leaves every digit untouched

Input

123
-4560
789

Output

123
-4560
789

A 0% digit error rate means no digit is ever selected for mutation, so the output is identical to the input.

Best Practices & Notes

Best Practices

  • Start with a low rate (5-10%) to see subtle corruption before ramping up to more aggressive rates.
  • Record the seed alongside any generated fixtures so the exact corruption can be reproduced later.

Developer Notes

Uses a mulberry32 PRNG (seeded, never Math.random()) to independently roll each digit against the configured rate, and a second draw (a mod-10 offset in 1-9) to pick a guaranteed-different replacement digit when a mutation triggers; the sign character is sliced off before iterating digits and reattached afterward so it's never part of the mutation pool.

Integer Digit Error Introducer Use Cases

  • Generating reproducible, rate-controlled corrupted test fixtures for a numeric parser
  • Measuring how a validator's failure rate scales with input corruption
  • Demonstrating digit-level data corruption in a QA or teaching context

Common Mistakes

  • Assuming a 20% rate means exactly 1 in 5 digits will change; it's an independent probability per digit, so the actual count varies run to run (though it's identical for a fixed seed).
  • Expecting the output to always have the same number of digits as the input; digit-level mutation preserves length, but a leading-zero result can look shorter in value even though it isn't shorter in characters.
  • Forgetting to change the seed between test cases and getting the same corruption pattern every time.

Tips

  • Try the same seed at several rates to see how corruption scales smoothly from subtle to severe.
  • Pair this with the Integer Digit Highlighter to visually spot exactly which digits changed.

References

Frequently Asked Questions