ASCII Case Randomizer
Randomize text letter casing with multiple modes: random, alternating, inverse, word-start, and custom probability. Copy results instantly.
About
Case randomization applies a stochastic or deterministic transformation to each alphabetic character in a string, toggling between its Unicode uppercase (0x41 - 0x5A) and lowercase (0x61 - 0x7A) representations. The process appears trivial until you consider encoding edge cases: characters outside the Basic Latin block, locale-sensitive mappings (Turkish dotted/dotless i), and surrogate pairs in UTF-16. This tool operates on the ASCII subset where toUpperCase and toLowerCase are bijective. Non-alphabetic characters pass through unchanged.
Random case text is used in meme culture, data augmentation for NLP model training, CAPTCHA-style obfuscation, and security testing of case-insensitive systems. A uniform random distribution with probability p = 0.5 yields maximum Shannon entropy per character at 1 bit. Adjusting p lets you control the density of uppercase characters. Note: this tool assumes ASCII Latin letters only. Characters with locale-dependent casing (e.g., German Γ β SS) are not expanded.
Formulas
For each alphabetic character c at position i in the input string, the randomized output character cβ² is determined by:
Where p β [0, 1] is the uppercase probability threshold. The default is p = 0.5 for uniform distribution.
Shannon entropy per character position:
For alternating mode, the rule is deterministic:
Where i is the zero-based index counting only alphabetic characters (non-alpha characters are skipped in the counter). The ASCII case offset is constant: charCode(a) β charCode(A) = 32.
Reference Data
| Mode | Description | Example Input | Example Output | Use Case |
|---|---|---|---|---|
| Random (p=0.5) | Each letter has 50% chance of uppercase | hello world | hElLo WoRlD | Meme text, data augmentation |
| Alternating (aAbB) | Even index β lower, odd index β upper | hello world | hElLo wOrLd | Stylized display text |
| Alternating (AaBb) | Even index β upper, odd index β lower | hello world | HeLlO WoRlD | Stylized display text |
| Inverse | Swap existing case of each letter | Hello World | hELLO wORLD | Case inversion testing |
| Word-Start Random | Randomize only the first letter of each word | hello world | Hello world / hello World | Name obfuscation |
| Custom Probability | User-set p for uppercase bias | hello world | Varies by p | Controlled randomness |
| ALL UPPER | Force all letters to uppercase | hello world | HELLO WORLD | Baseline comparison |
| all lower | Force all letters to lowercase | HELLO WORLD | hello world | Baseline comparison |
| ASCII Range | Uppercase: 65 - 90 | Decimal code points for A - Z | ||
| ASCII Range | Lowercase: 97 - 122 | Decimal code points for a - z | ||
| Case Offset | Difference: 32 | a = A + 32 | ||
| Entropy (p=0.5) | 1.0 bit/char | Maximum information per binary choice | ||
| Entropy (p=0.8) | 0.722 bit/char | Biased toward uppercase | ||
| Entropy (p=0.2) | 0.722 bit/char | Biased toward lowercase | ||
| Total Latin Letters | 52 | 26 upper + 26 lower | ||