The CSS Speech Bubble Generator is a free browser tool that creates a rounded speech bubble with a pure-CSS triangular tail, needs no account or sign-up, and outputs copy-ready class and ::after rules.
All geometry is calculated locally and deterministically. Nothing is uploaded or retained, and the tool introduces no new dependency into your project. Its output is the visual foundation: after copying the CSS, you still need to add the content, layout, semantics, contrast, and responsive spacing required by the component that will contain it.

What the generator creates
The generated result contains a relatively positioned base class and an absolutely positioned ::after pseudo-element. The base provides the rounded bubble surface, while the pseudo-element creates its triangular pointer without an image or SVG asset.
The live preview draws the triangle with a real child element because inline styles cannot target a pseudo-element directly. The copied CSS uses the production-ready ::after form. Both paths use the same validated size, color, side, and offset calculation, so the preview accurately represents the geometry that will be copied.
| Control | Supported input | Purpose |
|---|---|---|
| Bubble color | Complete six-digit hexadecimal color | Sets the bubble surface and matching tail color |
| Text color | Complete six-digit hexadecimal color | Sets the text placed inside the bubble |
| Corner radius | 0–80 pixels | Controls the rounding of the bubble corners |
| Tail size | 4–40 pixels | Controls the visible projection and half of the triangle base |
| Tail direction | Top, right, bottom, or left | Chooses which side receives the centered pointer |
Color inputs do not accept partial, empty, or abbreviated values. Likewise, empty numeric fields are rejected rather than being interpreted as zero. This validation keeps the generated geometry deterministic and makes invalid output less likely.
Build a speech bubble in four steps
- Open the CSS Speech Bubble Generator and choose the bubble and text colors. Enter each color as a complete six-digit hexadecimal value, such as a three-digit shorthand expanded to six digits before use.
- Set the corner radius and triangle tail size. The radius can range from zero through 80 pixels, while the tail size can range from 4 through 40 pixels. Tail size changes both the pointer's visible projection and its triangle half-base, so compare the preview at the size your interface requires.
- Select top, right, bottom, or left for the tail, then inspect the live preview. Check that the pointer is centered on the selected edge and that it does not overlap nearby content.
- Copy the complete class and pseudo-element rule into your stylesheet, then add the content layout, semantic markup, contrast checks, and responsive spacing needed by your component. The generated CSS intentionally omits content, padding, width, typography, animation, and interaction logic because those decisions belong to the surrounding application.
How the pure-CSS tail is formed
The tail uses the CSS border model rather than a bitmap or vector asset. Its pseudo-element begins with zero width and zero height. Two adjacent borders receive transparent colors, while the border opposite the selected side receives the bubble color. The colored border forms the visible triangle.
- For a bottom tail, the left and right borders are transparent and the top border is colored. The pointer appears below the bubble and is centered horizontally.
- For a top tail, the colored border is reversed to the bottom edge, placing the pointer above the bubble.
- For a left tail, the top and bottom borders are transparent and the right border is colored. The pointer is placed to the left and centered vertically.
- For a right tail, the top and bottom borders are transparent and the left border is colored. The pointer is placed to the right and centered vertically.
This method relies on standard CSS borders rather than an image or SVG. The CSS Backgrounds and Borders Level 3 border specification describes the underlying border model, while MDN's border-style reference documents the relevant property behavior.
The copied declarations are explicit, which makes the geometry easier to inspect in developer tools. The pointer is centered on its selected side by default. If it should point toward an avatar, anchor, or other feature, adjust the copied 50% position after applying the rule. A decorative pointer does not create a semantic relationship between the bubble and that target.
Integrate the copied rule into a component
Think of the generated CSS as a reusable shape, not a finished interface component. Apply the copied base class to an appropriate HTML element, then add the declarations that the generator intentionally leaves out.
- Add sensible padding, a useful maximum width, typography, line height, and text alignment for the actual message content.
- Add wrapping rules for long unbroken strings, translated copy, and narrow mobile widths. A production bubble should not force its tail into neighboring text or controls.
- Reserve outer space on the selected tail side. The pointer extends beyond the bubble surface, so padding inside the element is not a substitute for room around it.
- Use your existing color, spacing, and typography tokens where appropriate instead of treating the generated values as permanent design-system decisions.
- Inspect the exact ancestor that will host the bubble. An ancestor with overflow: hidden can clip the pointer, and a containing block with insufficient space can create the same visible result.
Because the base class is relatively positioned, it establishes the positioning context for its absolute pseudo-element. Preserve that relationship when the rule is moved into a component stylesheet or wrapped in another layout system.
Check readability and responsive behavior
The generator does not calculate WCAG contrast ratios. A bubble and text combination can look balanced in the preview while remaining difficult to read, so compare the selected text color against the actual bubble background. Test the component in normal and high-contrast modes rather than relying on the preview alone.
Long words, translated labels, browser zoom, and narrow mobile widths may expand the bubble or make the tail collide with surrounding content. Give the component a sensible maximum width, allow text to wrap, preserve padding, and leave enough space outside the selected tail edge. Inspect every responsive breakpoint in the real container that will hold the bubble.
Chat placement is also not a substitute for readable message information. Expose the author, message order, delivery status, and timestamp in text so that meaning does not depend only on whether the bubble appears on the left or right. Use the document's logical reading order and verify it with assistive technology when the component handles a complete conversation.
For a quotation or static callout, a paragraph can provide suitable text semantics. For a chat message, a list item within a logically ordered list can represent the message as part of a sequence. Neither choice is supplied automatically by the generator, so the shape and its host element still need to fit the content model.
Match the shape to its purpose
| Use case | Appropriate structure | Checks to perform |
|---|---|---|
| Static quotation or callout | Use a paragraph for quoted text when that matches the surrounding document | Confirm text contrast, logical reading order, and enough space for the decorative pointer |
| Chat message | Use a list item within a logically ordered message list | Expose author, order, status, and timestamp in text instead of relying on left or right placement alone |
| Interactive tooltip | Use a tooltip pattern only after adding a proper trigger association and suitable semantics | Verify keyboard reachability, focus behavior, predictable dismissal, and an accessible relationship with the trigger |
The same visual geometry can support these patterns, but the surrounding behavior differs. A tail does not make a box into a tooltip. If the bubble appears on hover, focus, or activation, implement the required trigger relationship, keyboard access, focus handling, and dismissal behavior before treating it as an interactive tooltip.
Know the generator's fixed boundaries
The tool is intentionally focused on one rounded bubble with one centered triangular tail. It does not provide custom tail offsets, multiple pointers, curved tails, outlines, or drop shadows. If one of those treatments is required, add it separately to the copied component rather than assuming the generator can produce it.
The color fields are also deliberately narrow: both must contain complete six-digit hexadecimal values. Named colors, RGB notation, and other color formats are outside the supported input contract. The accepted radius and tail ranges are fixed at 0–80 pixels and 4–40 pixels respectively.
The preview and copied CSS remain useful because they expose the geometry clearly, but they do not decide the semantic role of the component. The final implementation also needs testing for contrast, high-contrast modes, zoom, localization, wrapping, overflow, reading order, and keyboard behavior where relevant. Keeping these responsibilities separate makes the generated CSS dependable without mistaking a decorative shape for a complete chat or tooltip system.