A CSS speech bubble generator is a browser tool that turns validated colors, a corner radius, and a triangle tail size into a copy-ready class plus a pseudo-element rule. The CSS Speech Bubble Generator accepts two complete six-digit hexadecimal colors, a corner radius between 0 and 80 pixels, and a tail size between 4 and 40 pixels, then lets you pick one of four tail sides: top, right, bottom, or left. The result is a relatively positioned base class and an absolutely positioned ::after pseudo-element that draws a triangle from borders alone, so no image, SVG, or extra markup is needed. All calculation happens locally and deterministically, nothing is uploaded, and the copied CSS intentionally omits content, padding, width, typography, and interaction logic so those concerns stay with the component using the shape. Treat the output as a focused geometry primitive and add the layout, semantics, contrast, and responsive behavior yourself.

Cheat Sheet: Inputs and Validated Ranges
The CSS Speech Bubble Generator keeps its surface area deliberately small. It validates every numeric control and refuses incomplete or empty values rather than silently coercing them, so a missing radius is a rejected input instead of being converted to zero. The table below summarizes exactly what the generator accepts and what it rejects.
| Control | Format | Accepted range | Behavior on invalid input |
|---|---|---|---|
| Bubble background color | Six-digit hex (#RRGGBB) | Required, complete value | Rejected, no fallback |
| Text color | Six-digit hex (#RRGGBB) | Required, complete value | Rejected, no fallback |
| Corner radius | Integer pixels | 0 through 80 | Empty input rejected, out-of-range rejected |
| Tail size | Integer pixels | 4 through 40 | Empty input rejected, out-of-range rejected |
| Tail side | Single selection | Top, right, bottom, left | One side is always chosen; no invalid state |
The numeric ranges are intentionally tight. A tail size below four pixels is too small to read as a pointer, and anything above forty pixels dominates the bubble instead of anchoring it. Corner radius caps at eighty because larger values would round the bubble toward a pill shape and visually compete with the triangle. Shorthand hex, named colors, rgb(), and hsl() are intentionally outside the focused color input, which is why the form expects a full #RRGGBB value every time.
Generate a Speech Bubble in Four Steps
- Pick the bubble and text colors. Enter two complete six-digit hexadecimal values such as #1e90ff for the background and #ffffff for the text. The background color is also the color used for one of the triangle's borders, so the pointer visually shares its hue with the bubble.
- Set the corner radius and triangle tail size. The radius rounds the message box; the tail size controls both the visible projection of the pointer and half the width of the triangle's base. Stay inside 0–80 px for the radius and 4–40 px for the tail.
- Select top, right, bottom, or left for the tail. The preview updates instantly so you can see how the geometry meets the bubble. The pointer is centered on its chosen side, so it sits halfway along that edge by default.
- Copy the CSS and extend it. The output is a base class plus an ::after pseudo-element rule. You still need to add a maximum width, padding, typography, word-wrap behavior, and any semantic wrapper such as a paragraph, list item, or chat container.
How the Triangle Tail Is Built From Borders
The tail is not a clip-path, an SVG, or an image. It is a zero-width, zero-height box whose borders are the entire triangle. The CSS Backgrounds and Borders specification defines how adjacent borders meet at a 45-degree miter when the element has no content area, and the W3C note on CSS Backgrounds and Borders Level 3 describes the resulting geometry as a solid triangle with two transparent wedges. The MDN reference for border-style confirms that any non-hidden border on a zero-size element renders as two intersecting triangles meeting at the center.
The generator's job is to map your selected side to the opposite border. Three transparent borders and one colored border form the pointer:
- Bottom tail: top border is the bubble color; left and right borders are transparent. The element is positioned below the bubble and centered horizontally with left: 50% and a negative margin-left equal to half the tail size.
- Top tail: bottom border is the bubble color; left, right, and top borders are transparent. The element sits above the bubble.
- Right tail: left border is the bubble color; top, bottom, and right borders are transparent. The element is positioned to the right and centered vertically with top: 50% plus a negative margin-top.
- Left tail: right border is the bubble color; top, bottom, and left borders are transparent.
Because the same size, color, side, and offset values flow into both paths, the preview matches the copied rule exactly. The generator writes explicit declarations so the geometry stays readable in the browser's developer tools, and the tail size you entered remains the single source of truth for both the visible projection and the centering offset.
After You Copy: Semantics, Contrast, and Responsive Spacing
The copied CSS is a focused geometry primitive. It intentionally omits content, padding, width, typography, animation, and interaction logic so those concerns stay with the component that uses the bubble. Before you ship it, run through a short checklist:
- Width and wrapping. Set a sensible maximum width such as max-width: 28rem and let long unbroken strings wrap with overflow-wrap: anywhere. Translated copy and URLs can otherwise stretch the box well past your intended size.
- Padding and reading comfort. Add padding: 0.75rem 1rem or similar so text never sits on the rounded edge. Generous inner spacing also keeps the tail away from your characters.
- Color contrast. The generator does not compute contrast ratios. A visually pleasing bubble can still be unreadable, so verify the text color against the bubble background using a WCAG 2.2 contrast checker, with a target of at least 4.5:1 for body text.
- Semantic wrapper. Use a paragraph for a pull quote, a list item for a chat message, or a tooltip pattern only when its interaction requirements are satisfied. A decorative pointer does not establish meaning, so the markup has to carry the relationship.
- Pointer alignment. The 50% offset centers the tail on its side. If the bubble is anchored to an avatar or icon, replace the centered offset with an explicit value so the pointer visually targets the right spot.
Integrate your existing design tokens, test the semantic reading order, verify keyboard behavior where relevant, and check high-contrast modes, zoom levels, localization, and overflow at the exact container that will host the pointer.
Why the Tail Gets Clipped in Real Layouts
Three patterns account for almost every "my tail disappeared" report. First, an ancestor with overflow: hidden will trim the pseudo-element when it extends past the parent's content edge, and the generator has no way to know that constraint exists. Second, a tight container can leave no outer space on the selected side, so the triangle is rendered into a margin that does not exist. Third, narrow mobile widths can push the bubble against its parent's edge or collide with a sibling, and the responsive breakpoint you wrote for desktop may not include enough outer room for the pointer.
Reserve space on the tail side, inspect every breakpoint, and either move the bubble inside a container with overflow: visible or pad the parent enough to keep the pseudo-element in view. If the layout still forces a clipped tail, shorten the tail size toward the lower end of the allowed range, drop the corner radius slightly so the box itself takes less space, or switch to a different tail side that has more room. Custom offsets, multiple pointers, curved tails, outlines, and drop shadows are intentionally outside this focused output, so reaching for them means moving beyond the generator and writing the geometry by hand.
For corner radius values, the rounding rules in CSS apply whether you set them by hand or paste them from this generator, so refer to the border-radius pixel versus percentage and corner order guide when you decide between px and % units. Open the CSS Speech Bubble Generator, lock in two valid colors, pick a radius and a tail within range, choose a side, copy the rule, and finish the component with width, padding, semantics, contrast, and responsive spacing. The generator gives you a focused geometry primitive; the rest of the bubble is yours.
If you're weighing options, Bulk CSS Stripes Generator: Pattern Sets for Components covers this in detail.