SVG Pattern Generator
Generates a repeating SVG pattern from ten styles: dots, grid, lines, vertical lines, diagonal, zigzag, waves, checker, plus and triangles. You set tile size, stroke, colours and get SVG and CSS.
Use the tool
Why this tool exists
Subtle patterns add texture to hero sections, cards and slides without the weight of a bitmap. A tiny SVG tile repeated by CSS is sharp at any resolution and costs a few hundred bytes. Writing the data URI by hand, with the right escaping, is where people trip up.
Pick a pattern, set the tile size and line width, choose a foreground and background colour, and the tool gives you the SVG markup plus a CSS block with the encoded data URI and background-size. A full-size preview shows how it tiles. The characters that break a URL, such as the percent sign, angle brackets and the hash, are escaped for you. It all runs in your browser and nothing is uploaded.
How to use it
- Choose a pattern type.
- Set the tile size and stroke width.
- Pick the pattern colour and background colour.
- Copy the SVG or the CSS background declaration.
Frequently asked questions
Will the pattern tile without seams?
The patterns are drawn to repeat across the tile edge. The diagonal pattern adds corner marks for that purpose. Odd stroke widths on very small tiles can still show anti-aliasing at some zoom levels.
What is in the CSS output?
A background colour, a background-image with the SVG as a URL-encoded data URI, and background-size set to the tile size. Paste it onto any element.
What range can the tile size have?
From 4 to 400 pixels square. Small tiles make fine, subtle textures, while larger tiles give bolder shapes. Line width and colours are independent of the tile size, so you can tune each separately.
Can I use it without CSS?
Yes. The SVG markup is also given as a standalone tile, so you can save it as a file, inline it in HTML or reuse it inside another graphic. Only the CSS block uses the data URI form.