GLITCH LAB v1.0 ezolab.dev / lab instrument SYS: READY ✦ Holiday cards

Effects/ Glitch Text [FX_03]/ Calibrated

Glitch Text

Copies a link to this page with your text and settings — whoever opens it sees the same effect. Send it to a friend, a colleague or save it for later.
Pure CSS Light · zero deps #cyberpunk#glitch#rgb#text

CSS glitch text effect: the word tears into strips that jump sideways while red and blue channels swing apart — then it rests. Pure CSS, any word.

Live viewport Optical bench
LIVE FEED 60.0 FPS | FRAME: 16.7ms RES: — [ + calibrated ]
Type any word: the preview changes at once, and so do the HTML you copy, the .zip and CodePen. Leave it empty to get the default word back.

How it works // breakdown

Spec-FX_03

This is a CSS glitch text effect that looks like a broken video signal: the colour channels swing apart, then thin strips of the word jump sideways one after another, top to bottom — left, left, right, right, left — hold for a few frames and snap back. Then the text rests. No JavaScript, any word, and the pause between glitches is a setting. Below: the six-copy trick behind the strips, how they move like a wave, and how to turn keyframes into formulas to get any pause.

Why this effect

Most glitch text I see looks scary or just shakes nonstop. I wanted the opposite: a word that stays calm and readable, then breaks once — channels swing, strips tear, everything settles with a bit of inertia — and goes quiet again. One precise glitch is stronger than ten random twitches. That pause is the whole trick, and it's why this one works on a real page, not only in a demo.

What you'll build

A heading that glitches once in a while like a digital signal error, and is plain, readable text the rest of the time. The motion has inertia: channels swing and settle, strips overshoot before they snap back — that's what separates a "beautiful" glitch from a random shake.

Types of glitch text

"Glitch text" covers a few different looks. Pick the one you mean:

Look What happens Where
RGB split Red, green and blue copies drift apart Chromatic Wave
Torn slices Thin strips of the word jump sideways this page
Scramble / decode Letters turn into random glyphs and lock back Scramble Text
Dying neon Letters flicker and one tube is broken Neon Sign

The classic 10-line version

Most CSS glitch text tutorials do this: two copies in ::before and ::after with a page-coloured background, a red and a blue edge, and a clip-path that jumps between a few slices:

The classic: two clipped copies jumping with steps()

It's a good start, but it never rests, every move is the same jerky jump, and the whole word sits under the slices. The version below keeps the word calm, tears it once with inertia, and leaves real gaps where the strips move out.

How the glitch text works

1. Three colour channels

The word itself is the green channel. Red and blue copies come from ::before and ::after, blended with mix-blend-mode: screen — screen adds light, so where all three overlap the letters are white:

span { position: relative; isolation: isolate; color: #00ff00; }
span::before, span::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
}
span::before { color: #ff0000; }
span::after { color: #0000ff; }
Green word + red and blue copies with screen, pushed apart a little

The full story of this part is in Chromatic Wave.

2. Six copies: one with holes, five strips

A strip has to move on its own, so it needs to be a separate element. The word is written six times and stacked in one grid cell (grid-area: 1 / 1):

  • the first copy is cut with clip-path: polygon(...) — the full word with five thin horizontal holes;
  • copies 2–6 are cut with clip-path: inset(...) to exactly one of those holes each.

Together they look like one word. Move a strip, and its hole is suddenly visible — a real tear, not a doubled letter.

span:nth-child(2) { clip-path: inset(28% -90px 67% -90px); }   /* the strip 28–33% */

The negative left and right insets let a strip slide outside the word without being cut off.

3. Strips go like a wave

Each strip has two numbers: --s — which side and how far (−1.5, −1, 1.2, 1.7, −1.2) and --t — when it jumps (1.2 s, 1.24 s, 1.3 s, 1.34 s, 1.45 s). The delays grow from top to bottom, so the tear runs down the word like a wave; the sides alternate, so it zig-zags left and right.

span:nth-child(2) { --s: -1.5; --t: 1.2s; }
span:nth-child(3) { --s: -1; --t: 1.24s; }
span:nth-child(4) { --s: 1.2; --t: 1.3s; }

4. Jump, hold, overshoot, snap back

A strip that slides smoothly looks like a CSS transition. A broken signal jumps, holds for a few frames, overshoots a little the other way and snaps into place:

@keyframes gt-tear {
  0%, 5.5%, 100% { transform: none; }
  1.2%, 3.5% { transform: translateX(calc(var(--s) * 24px)); }   /* jump and hold */
  4.5% { transform: translateX(calc(var(--s) * -6px)); }         /* overshoot */
}

The channels do the same with more inertia: a damped wave (12px, −9, 5, −2) and then a few short flashes.

The video version: a channel wave, then strips tearing top to bottom

5. A real pause: keyframes turned into formulas

In the video the whole glitch lives in a 4-second loop, so the pause can't be changed on its own. The customizable version keeps the same motion but drives it with a clock.

@property lets CSS animate a number --gt-t from 0 to 1 once per glitch (1.8 s) + pause. From it, --gt-ms counts milliseconds into the glitch — 0 → 1800, then it stays at 1800 for the whole pause:

.gt-glitch {
  animation: gt-clock calc((1.8 + var(--gt-pause)) * 1s) linear infinite;
  --gt-ms: calc(clamp(0, var(--gt-t) * (1.8 + var(--gt-pause)) / 1.8, 1) * 1800);
}

Each keyframe path becomes a formula of --gt-ms. A strip's "jump, hold, overshoot, back" is three ramps — clamp(0, x, 1) is a ramp that goes from 0 to 1 and then stays:

--gt-m: calc(var(--gt-ms) - var(--t));        /* ms since this strip's moment */
transform: translateX(calc(var(--s) * var(--gt-tear) * (
  clamp(0, var(--gt-m) / 48, 1)                /* jump in 48 ms */
  - clamp(0, (var(--gt-m) - 140) / 40, 1) * 1.25   /* swing to −25% */
  + clamp(0, (var(--gt-m) - 180) / 40, 1) * 0.25   /* and back to 0 */
)));

The channel wave is a sine that loses strength, exactly like the 12 → −9 → 5 → −2px keyframes:

max(0, 1 - var(--gt-ms) / 960) * 1.14 * sin(var(--gt-ms) * 0.75deg)

When --gt-ms reaches the end, every formula is back at 0 — the word rests for as long as the pause says.

Make it yours

Variable Default What it changes
--gt-pause 2.2 Seconds of calm between glitches. 8–15 for headers and menus.
--gt-tear 24px How far a strip jumps (each strip multiplies it by its --s).
--gt-split 12px How far red and blue swing.
--gt-size 50px Text size.
--gt-red, --gt-green, --gt-blue pure RGB Channels. Pure values give a white word.

To change the text, change it in all six copies, both inside and in data-text.

Gotchas

  • All six copies must be identical, text and data-text, or the strips won't line up.
  • Use a dark background — screen adds light, so on white the word disappears.
  • Strip positions are in % of the line height. If you change line-height a lot, adjust the insets.
  • Don't use it on body text. Headings, logos, buttons — short words.
  • Old browsers without @property don't run the clock: the word just stands still, which is a safe fallback.

Accessibility

Only the first copy is read by screen readers; the other five have aria-hidden="true". With prefers-reduced-motion the clock stops, so the word doesn't glitch at all.

Variations

  • Glitch on hover — run the clock only on :hover for links and buttons.
  • More or fewer strips — add a copy and a hole, or remove one. Three strips look calm, eight look like a dying VHS tape.
  • Neon + glitch — a glitching neon sign is a classic. See Neon Sign.
  • Glitch a picture — the same torn strips and RGB split on a photo: Glitch Image.

FAQ

Is there a CSS glitch text generator?

This page works as one: type your word in "Your text", set the pause, tear and channel split with the sliders, then copy the HTML and CSS or download them as a .zip. The "glitch text generators" for Discord or Instagram names are something else — they add Unicode combining marks (the "zalgo" look) to plain text, with no CSS at all.

How do I make a glitch text effect in CSS without JavaScript?

Stack several copies of the word, cut them into strips with clip-path, move the strips with @keyframes, and add red and blue copies with mix-blend-mode: screen for the colour channels. Everything on this page is CSS.

Why does my glitch look doubled instead of torn?

The base word is still complete under the moved strip. Cut holes in the base copy where the strips are (clip-path: polygon), so moving a strip reveals an empty gap.

How do I make the glitch happen less often?

Raise the pause. In the customizable version it's --gt-pause; in a plain keyframe version, make the animation longer and keep all the motion in the first percent of the keyframes.

Do I need JavaScript or SVG filters for glitch text?

No — everything here is CSS. An SVG filter (feTurbulence, feDisplacementMap) can bend letters in wavy noise, which CSS can't, but it's heavier and harder to tune. JavaScript is worth it when the glitch has to be random — new glyphs every frame, like Scramble Text.

Get the code — copy or download
Copy HTML: the markup with your text — paste it where the effect should be. Copy CSS: the styles with your slider settings — paste into your stylesheet. Any text element works: give it the class and a data-text equal to its text.
or
↓ Download .zip Both files in one archive — index.html and style.css — with your text and settings. Unzip and open index.html in a browser.
/* Glitch Text — strips tear sideways top to bottom,
   RGB channels swing apart. Pure CSS.
   Six identical copies of the word, each with data-text:
   the first stays put (with holes), the others are strips.
   Font: Space Grotesk (Google Fonts), falls back to system-ui.
   Settings: change the variables below. */
.gt-glitch {
  --gt-tear: 24px;   /* how far a strip jumps */
  --gt-split: 12px;  /* how far red and blue swing */
  --gt-pause: 2.2;   /* seconds between glitches */
  --gt-size: 50px;
  --gt-red: #ff0000;
  --gt-green: #00ff00;
  --gt-blue: #0000ff;

  display: grid;
  margin: 0;
  font: 700 var(--gt-size) "Space Grotesk", system-ui, sans-serif;
  letter-spacing: 0.06em;
  white-space: nowrap;
  /* A clock: --gt-t runs 0 → 1 once per glitch (1.8 s) + pause */
  animation: gt-clock calc((1.8 + var(--gt-pause)) * 1s) linear infinite;
  /* --gt-ms: milliseconds into the glitch, 0 → 1800, then held */
  --gt-ms: calc(clamp(0, var(--gt-t) * (1.8 + var(--gt-pause)) / 1.8, 1) * 1800);
  /* Channels: a damped wave (0–960 ms), then flashes (1120–1720 ms) */
  --gt-w: calc(var(--gt-split) * (
    max(0, 1 - var(--gt-ms) / 960) * 1.14 * sin(var(--gt-ms) * 0.75deg)
    + clamp(0, (var(--gt-ms) - 1120) / 60, 1) * max(0, 1 - (var(--gt-ms) - 1120) / 600)
      * 0.45 * sin((var(--gt-ms) - 1180) * 1.5deg)
  ));
}

/* The copies are stacked in one grid cell. A strip's move:
   jump (48 ms), hold, overshoot −25% (at 180 ms), back (220 ms) */
.gt-glitch span {
  --l: calc(var(--gt-tear) * -4);
  --r: calc(100% + var(--gt-tear) * 4);
  --t: 0;
  --gt-m: calc(var(--gt-ms) - var(--t));
  grid-area: 1 / 1;
  position: relative;
  isolation: isolate;
  color: var(--gt-green);
  transform: translateX(calc(var(--s, 0) * var(--gt-tear) * (
    clamp(0, var(--gt-m) / 48, 1)
    - clamp(0, (var(--gt-m) - 140) / 40, 1) * 1.25
    + clamp(0, (var(--gt-m) - 180) / 40, 1) * 0.25
  )));
}

/* First copy stays put; the strips are cut out of it */
.gt-glitch span:nth-child(1) {
  --s: 0;
  clip-path: polygon(
    var(--l) 0, var(--r) 0, var(--r) 28%, var(--l) 28%,
    var(--l) 33%, var(--r) 33%, var(--r) 40%, var(--l) 40%,
    var(--l) 43%, var(--r) 43%, var(--r) 46%, var(--l) 46%,
    var(--l) 54%, var(--r) 54%, var(--r) 60%, var(--l) 60%,
    var(--l) 63%, var(--r) 63%, var(--r) 66%, var(--l) 66%,
    var(--l) 72%, var(--r) 72%, var(--r) 100%, var(--l) 100%
  );
}

/* The strips, top to bottom: --s = side and strength,
   --t = when it jumps (ms), so they go like a wave */
.gt-glitch span:nth-child(2) {
  --s: -1.5; --t: 1200;
  clip-path: inset(28% var(--l) 67% var(--l));
}
.gt-glitch span:nth-child(3) {
  --s: -1; --t: 1240;
  clip-path: inset(40% var(--l) 57% var(--l));
}
.gt-glitch span:nth-child(4) {
  --s: 1.2; --t: 1300;
  clip-path: inset(46% var(--l) 46% var(--l));
}
.gt-glitch span:nth-child(5) {
  --s: 1.7; --t: 1340;
  clip-path: inset(60% var(--l) 37% var(--l));
}
.gt-glitch span:nth-child(6) {
  --s: -1.2; --t: 1450;
  clip-path: inset(66% var(--l) 28% var(--l));
}

/* Red and blue channels over the green word; screen adds light */
.gt-glitch span::before,
.gt-glitch span::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  transform: translateX(calc(var(--d) * var(--gt-w)));
}
.gt-glitch span::before { --d: 1; color: var(--gt-red); }
.gt-glitch span::after { --d: -1; color: var(--gt-blue); }

@property --gt-t {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@keyframes gt-clock {
  to { --gt-t: 1; }
}

/* Less motion: no glitch, the word just stands still. */
@media (prefers-reduced-motion: reduce) {
  .gt-glitch { animation: none; }
}