How this calculator works
Unicode has combining marks that are drawn across the character before them. The long stroke overlay draws a continuous horizontal line, and the short stroke overlay draws a broken one that can look like a dashed strike. The two solidus overlays draw a diagonal slash, which is the style used to mark a crossed-out word in some handwriting. Spaces get no mark, because a mark attached to a space has nothing to cross, and an existing combining mark is skipped so its own accent is not disturbed.
Formula
For each character in the input: copy the character, then, unless it is a space, tab, newline or an existing combining mark, append the chosen overlay mark. The long line uses U+0336, the dashed line U+0335, the long slash U+0338 and the short slash U+0337. The mark count equals the number of non-space characters.
Worked example
Typing sold out with the solid line gives the same seven letters and the space, with seven overlay marks, one after each letter from s to t. The space has none. The result is one string that can be pasted into a message. If you copy the text again later, each mark travels with its letter and the line follows.
Advertisement
Frequently asked questions
Is this the same as real strikethrough formatting?
No. Real strikethrough is a font style that a document or web page applies to a range of text. This page inserts invisible combining marks, so the effect is part of the characters themselves. Use HTML del, or the formatting button in a word processor, when you control the document.
Why does the line look broken or doubled?
The exact shape depends on the font. A font may draw the overlay thinner, thicker, higher or lower than another, and a character with an accent already has two marks to place. Test the result in the app where you plan to use it before you rely on it.
Can I remove the strikethrough later?
Only by deleting the overlay marks. They are separate code points, so a browser or app may treat the text as a different string from the word you typed. If you need to keep the original, paste a plain copy somewhere before you convert.
Does it work on numbers and punctuation?
Yes. Any non-space character can take an overlay, including digits, punctuation and symbols. Emoji are made of more than one code point in some cases, so the mark may attach to the last part of the emoji and sit in an unexpected place.
Is struck-through text accessible?
The result is not semantically strikethrough to a screen reader, and some readers will read the overlay marks as separate characters or ignore them. For content that must be understood, use real formatting and do not rely on character tricks.