View all expressions
Randomness

Text Glitch Effect Expression

Applies a real-time text glitch effect by randomly corrupting characters each frame using ASCII symbols, Unicode blocks, duplicates, and case flips. Sliders let you control glitch speed and corruption intensity. *For best results, use fonts like Arial that support a wide range of symbols.

Contributed by:


// Apply to Source Text
originalText = text.sourceText;
// Replace with your text or use: text.sourceText
glitchSpeed = effect("Speed")("Slider");
// Glitch speed;
Connect to a Slider Control for easier adjustments
corruption = effect("Corruption")("Slider");
// Corruption level (0-100);
Connect to a Slider Control for easier adjustments
corruptionLevel = corruption / 100;
// 0-1
// Glitch character sets
glitchChars = "!@#$%^&*()_+-=[]{}|;':\"<>?,./~`";unicodeGlitch = "▓▒░█▄▀■□▪▫◘◙☼♠♣♥♦";
result = "";
seedRandom(Math.floor(time * glitchSpeed * 10), true);
for (i = 0; i < originalText.length; i++) {
char = originalText.charAt(i);
if (char == " ") {
result += " ";
// Preserve spaces
}
else if (random() < corruptionLevel) {
// Apply corruption
corruptionType = Math.floor(random(4));
switch (corruptionType) {
case 0:
// Random ASCII glitch
result += glitchChars.charAt(Math.floor(random(glitchChars.length)));
break;
case 1:
// Unicode blocks
result += unicodeGlitch.charAt(Math.floor(random(unicodeGlitch.length)));
break;
case 2:
// Duplicate character
result += char + char;
break;
case 3:
// Random case change
result += (random() > 0.5) ? char.toUpperCase() : char.toLowerCase();
break;
}}
else {
result += char;
// Keep original character
}}
result;

Text Glitch Effect Expression

Practical use case

Create glitchy titles, cyberpunk-style typography, or hacking-inspired motion graphics with full control over speed and distortion.

Check out similar expressions

Data-driven video workflows for After Effects are easier with Plainly.

a mesh of elegant lines transparent image