Border Generator

Configure border width, style, color and corner radius.

Set border width, style, color and corner radius with a live preview and copy the two CSS lines. You can use one radius for all corners or set each corner separately. It is quick for developers who want rounded boxes and dashed or double borders without looking up syntax.

What are CSS border and border-radius?

The border shorthand sets the width, style and color of an element's edge, in that order, for example 3px solid #6366f1. The style can be solid, dashed, dotted, double, groove, ridge, inset or outset; without a style no border is drawn. The border-radius property rounds the corners of the box. One value rounds all four corners equally. Four values apply, in order, to the top left, top right, bottom right and bottom left corners, going clockwise from the top left. A radius large enough relative to the box produces pill and circle shapes. Rounding also clips the background and the border to the curved edge.

How to use Border Generator

  1. Pick width and style Enter Width (px) and choose a Style from the list.
  2. Pick the color Use the picker or type a HEX value in Color.
  3. Set the corners Enter a Radius (px), or tick Set each corner separately and fill in the four corner fields.
  4. Copy the CSS Copy both lines from the CSS output box.

Frequently asked questions

In what order are the corner values written?

Top left, top right, bottom right, bottom left. That is the order of the four fields and of the values in the border-radius line, matching CSS clockwise order starting at the top left.

Can I set different widths per side?

No. The tool outputs one border shorthand for all four sides. For different widths or colors per side, edit the copied CSS or use border-top and similar properties.

Does it support elliptical radii?

No. Each corner takes a single pixel value, which creates a circular curve. The slash syntax for horizontal and vertical radii is not generated.

Why does the output contain 0px rather than 0?

Every radius value is written with the px unit, including zeros. 0px is valid CSS and means the same as 0.

Does the preview match the CSS?

Yes. The preview box uses the same width, style, color and radius values that appear in the CSS output.