Text

ScrambleText

ScrambleText is a GSAP plugin that animates an element's text by cycling each character through random symbols before it locks onto the final string. The progressive lock reads as a decode or terminal effect, where the message resolves out of noise instead of just fading in.

Updated June 30, 2026

Mechanics

How ScrambleText works

On every tick of the tween, ScrambleText rewrites the element's textContent. Some characters are already locked to the real target text, the rest are random filler pulled from a charset. As progress moves from 0 to 1, more characters lock in and the filler shrinks, so the final string emerges out of the scramble.

script.js

Use ease: "none" on the tween itself. The scramble has its own internal cadence, so an easing curve on top fights it and makes the lock-in rate feel uneven. revealDelay is how long the characters keep scrambling before any of them start resolving, which buys you a beat of pure noise at the start.

Config

The scrambleText object

You can pass a plain string as a shorthand for the target text, or an object for full control:

  • text - the final string to resolve to. Pass "{original}" to scramble back to whatever text is already in the element.
  • chars - the filler set. A custom string like "01" for binary, or the keywords "upperCase", "lowerCase", "upperAndLowerCase".
  • speed - how fast the filler characters churn. Higher is busier, 1 is the default.
  • revealDelay - seconds of scramble before characters start locking to the real text.
  • newClass / oldClass - CSS classes applied to the not-yet-revealed vs already-revealed characters, which is how you color the noise differently from the resolved text.
  • delimiter - split on something other than per-character (e.g. " " to scramble whole words).
When

Use it for

  • Decode-style hero headlines on dev tools, security, and gaming products
  • Hover labels on nav links or buttons that flip text on enter
  • Status text swapping in place (Loading resolving into Ready)
  • Code, hashes, or numbers that should read as 'computed' rather than typed
Alternatives

Use something else when

  • You want a per-character entrance with no glyph churn (slide or fade each letter in) - use SplitText plus a staggered tween, no ScrambleText
  • You want text typed one character at a time - that's a typewriter reveal (a width mask or a stepped substring), not a scramble
  • You want one word's letters to morph into another word's shapes - that's an SVG or Flip morph, not a text-content swap
  • The user has prefers-reduced-motion: reduce set - skip the scramble and set the final text instantly via gsap.matchMedia
In production

Used in these Annnimate components

Two Annnimate components produce the scramble effect, and they take opposite routes to it:

  • Dual Scramble runs two ScrambleText tweens back to back. The text scrambles through a brand-accent color first, then resolves into the final foreground, using oldClass and newClass to recolor characters as they lock.
  • Text Scramble reproduces the same decode reveal with a hand-written character cycler instead of the plugin. Worth knowing the effect is buildable without ScrambleText when you want full control over the charset and timing.

Keep the real text readable

ScrambleText rewrites textContent, so a screen reader hears the noise mid-tween. Dual Scramble fixes this with stacked spans: the visible layer scrambles while a real-text layer stays in the DOM for assistive tech. Random filler also has uneven glyph widths, so use a monospace font or reserve the width to avoid layout shift while it churns.
Used in components

See it running in production

FAQ

Common questions

Is ScrambleTextPlugin free or do I need a Club GSAP membership?
It's free. Webflow made GSAP and every former Club plugin (ScrambleText included) 100% free for commercial use, fully live as of April 30 2025 (webflow.com/blog, css-tricks.com 2024-25). Any tutorial that calls it a paid or Club-only plugin predates GSAP 3.13. Just install gsap and import it from gsap/ScrambleTextPlugin.
Do I need to register ScrambleTextPlugin before using it?
Yes. Add import { ScrambleTextPlugin } from 'gsap/ScrambleTextPlugin' and gsap.registerPlugin(ScrambleTextPlugin) once at module load. In Next.js or any SSR setup, guard it with if (typeof window !== 'undefined') so it only runs client-side. A missing registration is the usual reason the text just snaps to its final value with no scramble.
How do I control which characters it scrambles through?
Set chars in the scrambleText object. Pass a custom string for an exact set ("01" for a binary matrix look, "!<>-_\\/[]{}" for glitch), or use the keywords "upperCase", "lowerCase", or "upperAndLowerCase". A monospace font plus a tight charset is what gives the terminal aesthetic.
ScrambleText vs SplitText, which one do I use?
Different jobs. SplitText breaks an element into separate character, word, or line nodes you then animate with position and opacity. ScrambleText leaves the element whole and cycles the glyphs in place. You reach for SplitText when letters need to move independently, and ScrambleText when the text should decode without any layout change. They compose: split into words, then scramble each.
Why does my layout jump while the text scrambles?
The random filler characters are wider or narrower than the final ones, so the element's width changes every tick. Use a monospace font so every glyph is the same width, or set a fixed width on the element. Keeping the real text in the DOM on a separate layer (the stacked-span approach) also gives you a stable box to size against.