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:
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; }
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.
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 —
screenadds light, so on white the word disappears. - Strip positions are in % of the line height. If you change
line-heighta lot, adjust the insets. - Don't use it on body text. Headings, logos, buttons — short words.
- Old browsers without
@propertydon'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
:hoverfor 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.