CSS Background Pattern Generator
Build a repeating CSS background for a page, card or section. Choose a pattern, adjust its geometry and colors, then copy the current declarations into your CSS rule.
Create a background pattern
- Choose Stripes, Grid, Dots or Checkerboard. Each pattern keeps its own geometry when you switch, while the foreground and background colors stay shared. None gives you a plain background.
- Enter whole CSS-pixel values and choose both colors and their opacity. Correct incomplete or invalid fields before copying. The light or dark backing behind the specimen is only a preview aid.
- Inspect the current pattern and CSS, then use Copy CSS. Paste the declarations inside a CSS rule for your element. If clipboard access is denied, use the current selectable fallback in the result card.
Understand the geometry and transparency
Pitch is the distance from one repeat to the next, rather than the empty space between marks. Grid and dot patterns have separate horizontal and vertical pitches, so their spacing can be rectangular.
A stripe's period is its foreground band width plus its gap. The CSS angle describes the gradient direction: 90 degrees points right and produces vertical bands. The repeating gradient fills the positioning area without a separate rotated rectangular tile.
Dots use a circular radius in CSS pixels. The diameter is twice that radius and must fit within both tile dimensions. Checkerboard instead uses one square cell size, with two cells on each side of the complete repeating tile.
The foreground is painted over one background base. Transparent gaps reveal that base, and a translucent base reveals the element's surroundings. Grid lines use two foreground layers, so their crossings can have a different color or opacity from a single line.
The output resets the background image, size, position, repetition, origin, clipping, attachment and blend mode. Existing element opacity, filters, masks or ancestor effects can still change the final appearance. The optional geometry details explain the active values without adding preview dimensions to the CSS.
Examples to try
Start with a 24 by 24 CSS-pixel grid and one-pixel vertical and horizontal lines. The code uses two gradients over the single background color. Changing one pitch changes that repeat distance without changing the other axis.
For vertical stripes, set the angle to 90 degrees, the foreground band to 4 pixels and the gap to 6 pixels. The period along the gradient line is 10 pixels. A four-pixel band with an eight-pixel gap instead has a twelve-pixel period.
Try dots with a 20 by 12 pixel tile and a radius of 3 pixels. Each dot has a six-pixel diameter and remains circular even though the repeat distances differ. The radius is not the tile width or a percentage of the element.
A checker cell of 10 pixels produces a 20 by 20 pixel tile. If the foreground opacity is zero and the base opacity is 50 percent, the base is still painted once. The invisible foreground does not add another copy of that base.
Scope and rendering limits
This editor offers four editable pattern families and None. It does not import arbitrary CSS or images, combine an unrestricted layer stack, animate a background, rotate checkerboards or export an image file.
Geometry uses bounded whole CSS pixels. Stripe widths and gaps run from 1 to 128 pixels; grid and dot pitches run from 2 to 256. Grid strokes must be smaller than their pitch, and a dot's diameter must fit the smaller pitch. Checker cells run from 1 to 128 pixels. These are editor limits, not the full CSS grammar.
Zero opacity and matching colors are valid settings, even when a pattern becomes invisible or appears flat. They do not automatically remove its gradient declarations. None is the explicit way to request no background image.
Browser support and edge antialiasing can differ. An unavailable preview is labelled separately from a valid authored CSS result. Inspect the copied CSS in your target layout and browsers; a live specimen is not a certification of every rendering environment.
Local authoring
Pattern settings and CSS are prepared in this page without uploading content or loading a user image. There is no saved account, input-bearing share URL or automatic clipboard access. Copy runs only when you request it, and ordinary Sources links open their external documents.
Questions about CSS patterns
Sources
These specifications describe the CSS and clipboard behavior used by this tool.
- W3Cw3.orgCSS Backgrounds and BordersBackground layers and longhand properties.
- W3Cw3.orgCSS Images Level 3Linear, radial and repeating gradients.
- W3Cw3.orgCSS Images Level 4Conic gradients; draft specification.
- W3Cw3.orgCSS Color Level 4Transparent color.
- W3Cw3.orgCompositing and BlendingSource-over compositing.
- W3Cw3.orgClipboard APIExplicit clipboard writing.
Specifications reviewed 17 November 2026; draft status and browser support can change.
Related tools
CSS Filter Generator
Order and repeat CSS effects, compare a specimen and copy the exact filter declaration.
Open tool — CSS Filter GeneratorFluid Font Size Calculator
Create root-relative CSS from viewport endpoints and inspect the copied size model.
Open tool — Fluid Font Size CalculatorCSS Button Generator
Style native button states, inspect keyboard focus and copy HTML and CSS.
Open tool — CSS Button GeneratorCSS Border Generator
Create borders with independent styles, widths, colors and opacity on all four sides.
Open tool — CSS Border GeneratorCSS Clip Path Generator
Edit polygon points and basic shapes, preview the clipping and copy CSS.
Open tool — CSS Clip Path GeneratorCSS Border Radius Generator
Edit eight corner radii, preview a box and copy CSS in pixels or percentages.
Open tool — CSS Border Radius GeneratorCSS Grid Generator
Build a bounded CSS Grid example with editable tracks, placement and named areas. Preview it, copy CSS or HTML and download the same standalone example.
Open tool — CSS Grid GeneratorCSS Flexbox Generator
Build a Flexbox example with container and item controls, explicit layout axes, matching CSS and HTML, and a local complete-example download.
Open tool — CSS Flexbox GeneratorCSS Text Shadow Generator
Build ordered text shadows, preview plain text and copy exact CSS.
Open tool — CSS Text Shadow GeneratorCSS Transform Generator
Compose repeatable 2D CSS transforms, edit px or percentage translation and origin, inspect a reference box and copy the exact current declarations.
Open tool — CSS Transform GeneratorCSS Cubic Bezier Generator
Edit CSS cubic-bezier curves with coordinates, visual handles and presets. Inspect overshoot, run a deliberate comparison with linear motion, and copy easing CSS.
Open tool — CSS Cubic Bezier GeneratorCSS Box Shadow Generator
Create ordered CSS box-shadow layers with a live preview and copyable code.
Open tool — CSS Box Shadow GeneratorHTML to Markdown
Convert pasted or local HTML into Markdown, review conversion notes, and copy or download the result.
Open tool — HTML to MarkdownJavaScript Regex Tester
Test a JavaScript pattern locally and inspect matches, captures, and UTF-16 positions.
Open tool — JavaScript Regex TesterMarkdown to HTML
Convert a Markdown draft to an HTML fragment, inspect the source and inert preview, then copy or download it.
Open tool — Markdown to HTMLCSS Gradient Generator
Create linear or radial CSS gradients with editable colors, opacity and stops.
Open tool — CSS Gradient GeneratorColor Converter
Convert supported sRGB HEX, RGB and HSL literals with alpha, explicit precision and current code Copy.
Open tool — Color ConverterHTML Entity Encoder/Decoder
Encode or decode literal HTML references with explicit context, Unicode options and LF output, without parsing or rendering markup.
Open tool — HTML Entity Encoder/DecoderMarkdown Table Generator
Edit a small literal-text table, set alignment and copy GFM Markdown or import tab-separated text.
Open tool — Markdown Table GeneratorHTML Table Generator
Build a rectangular table with captions and headers, then copy HTML and CSS.
Open tool — HTML Table GeneratorQuery String Parser & Builder
Edit ordered URL parameters, retain repeated names and copy a normalized query or HTTP(S) URL.
Open tool — Query String Parser & BuilderURL Encoder & Decoder
Convert a UTF-8 URL component or form value with explicit space and plus rules, then copy or download the result.
Open tool — URL Encoder & DecoderColor Contrast Checker
Compare foreground and background colors, adjust opacity and check WCAG numerical contrast thresholds for text and essential interface details.
Open tool — Color Contrast CheckerBase64 Encoder & Decoder
Encode UTF-8 text as standard or URL-safe Base64, or decode either format with clear errors and complete text output.
Open tool — Base64 Encoder & Decoder