Skip to content
UniKit

Colored text generator

Turn text into colored HTML you can paste straight into rich-text or blog editors: per character, per word or per line coloring with inline styles, a palette cycle, gradients between palette colors, reproducible seeded randomness, plus font size, weight, background and stroke. All user text is escaped, never executed as markup.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Text

Spaces and line breaks are kept as they are, line breaks become <br>; all user text is escaped first (& < > " ' turn into entities) so it can never be parsed as markup.

Font size, weight, background and stroke go on the outer span’s style; each color goes on its own unit. Some editors drop the outer span but keep the colors.

Colored HTML

A copy-ready HTML fragment with colors in inline styles; the preview renders exactly this fragment.

Enter text to see the colored HTML

What this tool does

  • Color titles or keywords for WeChat articles, blogs, emails and notes: the tool emits HTML with inline styles, so pasting it into a rich-text editor shows the colors right away.
  • Build gradient, rainbow or outlined text: colors are interpolated between your palette stops, or picked with a reproducible seeded random.
  • Get a colored fragment ready for a CMS or template: copy the generated HTML instead of hand-writing a span per character.

Example

Input

彩色文字

Output

<span style="color:#e11d48">彩</span><span style="color:#f59e0b">色</span><span style="color:#10b981">文</span><span style="color:#3b82f6">字</span>

Defaults (per character, the built-in 5-color palette cycling, no wrapper styles): one span per character with colors taken from the palette in order.

Frequently asked questions

Where can I paste the generated HTML?

The WeChat article editor usually keeps inline color, font-size, font-weight and background on spans, but often drops the outer wrapper, classes and <style> blocks, and its support for -webkit-text-stroke (outlines) is unreliable, so outlines may disappear after pasting. Blogs (WordPress, Hexo admin), email templates, rich-text pasting in Notion and Word generally keep inline styles. To paste raw code, switch the target editor to HTML / code mode first.

Can my input inject markup?

No. Every user character is escaped first (& < > " ' become entities), so <script>alert(1)</script> is displayed as text and never parsed. The only tags in the output are the coloring spans generated by this tool, and the only attribute is style, filled from parsed palette values.

How is the random coloring reproducible?

Randomness comes from the mulberry32 generator seeded with the seed you pass — no Math.random and no clock. The same text, palette and seed produce a byte-identical output, and both the result object and the UI expose the seed that was used. The default seed is 42.

What is the difference between per character, per word and per line?

Per character gives every character its own unit; per word splits on whitespace (English words split naturally, while a run of glued CJK text counts as a single word — use per character when every ideograph needs its own color); per line uses one color for each line, which suits a gradient headline. Whitespace is never colored and is kept as-is, and line breaks always become <br>.

How is the gradient computed?

The palette colors act as stops and colors are linearly interpolated between the two neighbouring stops according to the unit index. Interpolation is done directly on sRGB R/G/B channels (the same sRGB convention as the color midpoint tool) without gamma expansion, and a single-color palette produces no gradient. Add more stops for a smoother ramp.

Keywords:colored text generatorgradient textinline styletxt-color

Related tools