cursivee.app

Blog · · 4 min read

What is Zalgo text, and how does it work?

Glitch text looks like a rendering bug, but it is ordinary letters carrying far more accent marks than anyone intended. Here is the mechanism, the history, and how to undo it.

The short answer

Zalgo text — also called glitch text or corrupted text — is normal text in which every letter has been loaded with combining marks: accents, dots, hooks and strokes that attach themselves to the character before them. Stack enough of them and the marks climb out of the line and over its neighbours:

g̢̛͖̳͋ͨ̃l̠̥̩͑̎̉͟ī̙̯ͣ͛̚͞t̻̘͎̉̔̑͟c̻̯̳͗̔͛͡h̨̟͖͑ͧͫ͞ t̝̰̦̉͗͌͟e͙̼͗͌͂̚͞x̷͎̙͓͌̈̏ẗ̼͙͈͐̉͡

Nothing is broken. No font is involved, and it is not an image. It is plain text behaving exactly as the standard says it should, pushed well past the point anyone designed for.

How combining marks work

There are two ways to write é in Unicode. One is a single ready-made character. The other is a plain e followed by a separate character, the combining acute accent, which has no width of its own and draws itself on top of whatever came before. Both look identical on screen.

The second method exists because the world's languages need far more letter-and-accent combinations than anyone could list in advance. Vietnamese routinely puts two marks on one vowel. Phonetic transcription uses more. So combining marks are designed to stack, and the standard sets no hard limit on how many may follow a letter. Unicode has a block of 112 general-purpose ones, with more elsewhere.

Glitch text takes that open-ended rule literally. Instead of one accent, a letter gets ten, or thirty. Each new mark is positioned relative to the last, so they pile outward from the letter.

Three directions of damage

Combining marks fall into three groups according to where they attach, and the look of glitch text depends on which are used:

  • Above — accents, rings and tildes that climb upward into the line before.
  • Below — cedillas, dots and hooks that hang down into the line after.
  • Through — strokes and slashes that cut across the letter itself, which is how strikethrough text is made.

The glitch text generator lets you switch each of these zones on or off and turn an intensity dial for how many marks land on each letter. Marks above only gives text that looks as though it is evaporating; marks below only makes it drip. The cursed text generator does the same thing on top of a substituted alphabet, so the letters underneath are wrong as well.

Where the name comes from

Zalgo began as an internet horror meme in the mid-2000s. Dave Kelly, posting on the Something Awful forums, edited ordinary newspaper comic strips so that the characters dissolved into something monstrous, attributing it to an entity called Zalgo. Text mangled with combining marks became the standard way of writing in Zalgo's voice, with the stock phrase "he comes", and the name stuck to the technique.

It reached a wider audience of programmers in 2009, through a celebrated Stack Overflow answer about why HTML cannot be parsed with regular expressions, in which the text itself progressively collapses into Zalgo as the author's composure does.

Why it looks different in every app

Unicode says the marks should stack. It does not say what an app must do when the stack is taller than the line. That decision belongs to whatever is drawing the text, and every renderer answers it differently:

  • Some let the marks overflow freely over adjacent lines. This is the full effect.
  • Some clip everything to the height of the line, cutting the towers off flat.
  • Some stop stacking after a few marks and draw the rest on top of each other as a smudge.
  • Some platforms strip excess marks when you post, as an anti-spam measure.

So the same string can look dramatic in one app and nearly normal in the next. If you are making glitch text for a particular place, test it there.

Is it harmful?

No. Zalgo text is not a virus, cannot damage a device and cannot hack an account. It is text. There are, though, three real costs:

  • It eats character limits. Every mark counts as a character. A letter with twenty marks uses twenty-one. A short phrase at high intensity can overrun a 150-character bio while looking no longer.
  • It covers other people's text. In a chat or comment thread, overflowing marks obscure the messages above and below. Many communities treat heavy Zalgo as spam and remove it.
  • It is hard on accessibility. Screen readers may try to announce every mark. See what screen readers do with fancy text.

At low intensity most of this disappears. A mark or two per letter reads as unease rather than noise, stays inside its own line, and tends to be the more effective look anyway.

How to remove Zalgo from text

Because the original letters are still there underneath, the damage is reversible: delete the combining marks and the plain text comes back. In JavaScript, one line does it:

text.normalize("NFD").replace(/\p{M}/gu, "")

This splits every character into its base letter and its marks, then removes all the marks. Be aware that it does not distinguish vandalism from spelling: it turns café into cafe as well. For text in English that is usually acceptable. For names and other languages it is not, and a gentler approach — allowing one or two marks per letter and removing the rest — is the better filter.

If you would rather add marks than remove them, the glitch generator is one click away.


← All posts

Keep reading