Menu

Unicode Text Styling: Bold, Italic & Strikethrough Without CSS
๐Ÿ–ผ๏ธ

Unicode Text Styling: Bold, Italic & Strikethrough Without CSS

DEV CommunityยทTechMindยท6 months ago
#eo9To7Ek
#ai#webdev#javascript#unicode#code
Reading 0:00
15s threshold

Most developers know HTML bold and italic tags. But what happens when your text lands in an environment that strips all HTML โ€” WhatsApp, Discord DMs, plain text emails, or Instagram captions?

The answer: Unicode mathematical characters.

Why Unicode Styling Works Everywhere

Unicode includes dedicated ranges for bold, italic, bold-italic, and styled variants of Latin letters. These are not formatting instructions โ€” they are different characters that happen to look styled.

Regular: Hello World Bold: ๐—›๐—ฒ๐—น๐—น๐—ผ ๐—ช๐—ผ๐—ฟ๐—น๐—ฑ Italic: ๐˜๐˜ฆ๐˜ญ๐˜ญ๐˜ฐ ๐˜ž๐˜ฐ๐˜ณ๐˜ญ๐˜ฅ Strike: Hฬถeฬถlฬถlฬถoฬถ ฬถWฬถoฬถrฬถlฬถdฬถ

Enter fullscreen mode

Exit fullscreen mode

Because they are actual characters, they survive:

Copy-paste into any app

Plain text environments

WhatsApp, Discord, Instagram, Telegram

SMS on modern phones

LinkedIn posts (which strip HTML completely)

The Unicode Ranges

Mathematical Bold โ€” starts at U+1D400

// Offset for bold lowercase 'a' = U+1D41A const BOLD_OFFSET_LOWER = 0x1D41A - ' a ' .โ€ฆ

Continue reading โ€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.