SVG Pattern Generator

Generate tileable SVG patterns like stripes, dots, checkerboard, waves, and hexagons. Customise colours, size, and spacing. Copy or download SVG.

Background patterns add texture and visual interest to web designs without heavy image files. This generator creates tileable SVG patterns - stripes, dots, checkerboards, diagonal lines, waves, and hexagons - with customisable colours, sizing, and rotation. The output is pure SVG code that scales perfectly at any resolution and weighs under 1 KB per tile.

Ad
Ad

About SVG Pattern Generator

How SVG Patterns Work

SVG (Scalable Vector Graphics) is an XML-based format defined by the W3C. Rather than storing pixels, SVG describes shapes mathematically - a circle is a centre point and radius, a line is two coordinates. The browser renders these descriptions into crisp visuals at any zoom level.

A tileable pattern works by defining a small rectangular tile that repeats without visible joins in both the x and y directions. The SVG <pattern> element, specified in the W3C SVG 1.1 standard, supports attributes like patternUnits (which sets the coordinate system) and patternTransform (which rotates or skews the tile). This tool generates standalone SVG files that tile through the CSS background-repeat: repeat property, giving the same visual result without the complexity of inline SVG pattern definitions.

Worked example - creating a striped background: Select "Stripes" as the pattern type, set element size to 8px and spacing to 12px. The generator produces a 20x20 SVG tile containing a single 8px-wide rectangle on a 20px-wide canvas. When the browser repeats this tile, the 8px filled strips alternate with 12px gaps, producing a clean striped background. The total SVG code is about 180 bytes - roughly 1,000 times smaller than an equivalent raster PNG tile at 2x resolution.

Available Pattern Types

PatternDescriptionBest For
StripesParallel lines with adjustable width and gapBackgrounds, headers, subtle texture
DotsEvenly spaced circles in a gridPolka dot backgrounds, subtle decoration
CheckerboardAlternating coloured squaresRetro designs, game boards, transparency indicators
Diagonal LinesAngled parallel linesWarning zones, construction themes, dynamic backgrounds
WavesSinusoidal curves repeating horizontallyWater themes, organic designs, gentle backgrounds
HexagonsHoneycomb grid of hexagonal cellsTech themes, science designs, modern backgrounds

Each pattern type uses a different SVG structure internally. Stripes and checkerboards use <rect> elements, dots use <circle>, diagonal lines use <line> with stroke widths, waves use cubic Bezier <path> curves, and hexagons use <polygon> elements with calculated vertex coordinates. The rotation control applies a patternTransform="rotate(N)" attribute to the tile, rotating the entire pattern without distorting the individual shapes.

Controls and Customisation

ControlWhat It AdjustsTypical Range
Foreground colourThe colour of the pattern elements (lines, dots, hexagons)Any hex colour
Background colourThe fill behind the pattern shapesAny hex colour
Element sizeWidth of lines, diameter of dots, side length of squares2-40px
SpacingGap between pattern elements2-50px
RotationAngle of the entire pattern0-360 degrees

The live preview tiles the pattern across a large area so you can verify the tiling at scale. Changes update instantly through reactive rendering - no need to click a generate button.

Why Use SVG Instead of Raster Patterns?

SVG enjoys universal browser support in 2026 - every modern browser renders SVG natively, according to Can I Use data showing a 100% compatibility score across current browser versions. Over 65% of all websites now use SVG imagery, up from 63.3% the previous year per the HTTP Archive Web Almanac.

FactorSVG PatternPNG/JPEG Pattern Tile
File sizeUnder 1 KB per tile (often 200-500 bytes)5-50 KB per tile at 2x resolution
ScalingInfinitely sharp at any zoom or DPIBlurry when scaled beyond native resolution
Retina/HiDPINo extra assets neededRequires 2x and 3x versions
EditabilityColours and sizes changeable in codeRequires re-export from design tool
HTTP requestsZero if inlined as data URI in CSSOne per tile image file
Gzip compressionSVG compresses extremely well (up to 92% reduction)Already compressed, little further gain

A Vecta.io benchmark found that a 1266-pixel-wide graphic that measured 26 KB as a JPG was just 2 KB as SVG - an 89% size reduction. For simple repeating patterns, the difference is even larger since pattern tiles use basic geometric shapes that compress to a few hundred bytes.

Using SVG Patterns in CSS

The CSS export gives you a ready-to-use background-image property using an inline SVG data URI. This embeds the pattern directly in your stylesheet with no extra HTTP request:

background-image: url("data:image/svg+xml,%3Csvg...");
background-repeat: repeat;

URL-encoded SVGs in data URIs produce 20-30% smaller output than Base64-encoded versions, so this tool uses URL encoding by default. For patterns under 2-3 KB (which covers virtually all simple geometric patterns), data URIs are the most efficient delivery method since they eliminate the round-trip latency of a separate HTTP request.

You can layer patterns with other backgrounds using CSS multiple backgrounds, or combine them with the CSS gradient generator for more complex effects. The glassmorphism generator also pairs well with subtle SVG patterns as a backdrop behind frosted-glass panels.

Export Options

FormatHow to UseBest For
Raw SVG codePaste into an SVG element or save as a .svg fileDesign tools, direct embedding in HTML
CSS background-imagePaste the data URI property into your stylesheetWeb development - zero extra HTTP requests
SVG file downloadSave to disk for use in design applicationsFigma, Sketch, Illustrator, print projects

Design Tips for Background Patterns

TipWhy
Keep contrast low between foreground and backgroundSubtle patterns add texture without competing with content
Use smaller element sizes (4-8px) for body backgroundsLarge pattern elements distract from text and UI components
Use larger elements (15-30px) for hero sectionsBolder patterns work well behind large headings and images
Match pattern colours to your brand paletteCohesive colour choices tie the pattern into the overall design
Test with content on topA pattern that looks good alone may interfere with text readability
Check dark mode appearanceA pattern designed for light backgrounds may need inverted colours in dark mode

For accessibility, the W3C Web Content Accessibility Guidelines (WCAG 2.2) require a minimum contrast ratio of 4.5:1 for normal text. When placing text over a patterned background, use the colour contrast checker to verify the foreground text remains readable against both the pattern's light and dark areas.

Common Pattern Use Cases

Geometric patterns are widely used in web and print design. Stripes and diagonal lines appear in construction and warning signage - the familiar yellow-and-black hazard pattern is a diagonal stripe at 45 degrees with alternating yellow and black bands. Dots at low opacity create a halftone texture popular in editorial and comic-style layouts. Checkerboard patterns serve a practical role in design tools as the universal indicator for transparency (the grey-and-white grid behind transparent areas in Photoshop and Figma). Hexagon grids convey a technical or scientific feel and are common in SaaS dashboards and data visualisation backgrounds.

SVG patterns also work well for print at any DPI. Since the vector data scales without quality loss, the same SVG tile used on a website at 96 DPI prints crisply at 300 DPI for business cards, posters, or packaging. This makes SVG patterns a practical choice for brands that need consistent assets across digital and physical media.

How Each Pattern Type Is Constructed

Stripes: A single <rect> fills the left portion of the tile with the foreground colour. The remaining space becomes the gap. When the tile repeats horizontally, the rects line up into continuous vertical stripes. Rotating the pattern by 90 degrees turns them into horizontal stripes, and 45 degrees produces diagonal stripes.

Dots: A <circle> element is centred within the tile. The radius is half the element size, and spacing controls the gap between circles. At larger sizes, dots become prominent circles suitable for retro polka-dot designs. At smaller sizes with low-contrast colours, they produce a subtle stippled texture.

Checkerboard: Two <rect> elements are placed at opposite corners of a tile that is double the normal width and height. This arrangement ensures that when the tile repeats, filled and empty squares alternate correctly in both directions.

Diagonal Lines: Three <line> elements cover the tile with stroke widths matching the element size. The extra lines at the tile edges ensure clean tiling - without them, gaps appear at the seams where tiles meet. The stroke-width property controls line thickness.

Waves: A quadratic Bezier <path> curve creates one wave cycle within the tile. The Q and T SVG path commands produce smooth sinusoidal shapes. The amplitude is proportional to the element size, giving you control over how pronounced the waves appear.

Hexagons: Six-vertex <polygon> elements are positioned using trigonometric calculations. Each hexagon vertex is computed as (cx + r*cos(angle), cy + r*sin(angle)) where the angle steps by 60 degrees. Five hexagons (centre plus four corners) cover the tile with appropriate overlap for gapless tiling.

Performance Considerations

Sites that switched from PNG to SVG for background assets saw 2-4 second load time improvements on 3G connections, with 15-25% better Core Web Vitals scores according to a study reported by DebugBear. For pattern backgrounds specifically, the gains are significant because a single 200-500 byte SVG tile replaces what would otherwise be a 10-50 KB raster image.

Keep pattern complexity reasonable for performance. Simple shapes (stripes, dots, checkerboards) render fastest because the browser paints them with minimal vector calculations. Hexagons and waves involve more path data but are still far lighter than raster alternatives. If you need organic, non-geometric shapes rather than tiled patterns, try the SVG blob generator instead.

For pages with heavy content, consider using SVG grain textures through the feTurbulence SVG filter at 15-30% opacity rather than repeating tile patterns. This is a growing trend in 2026 web design, adding a tactile paper-like quality to hero sections without any additional file downloads.

Everything runs in your browser with no data sent to any server.

Sources

Frequently Asked Questions

What patterns can I generate?

Stripes (horizontal, vertical, diagonal), dots, checkerboard, diagonal lines, waves, and hexagons. Each pattern type has controls for size, spacing, and rotation.

Are the patterns truly tileable?

Yes. Every pattern tiles without visible seams in all directions. The live preview shows the pattern repeated across a large area so you can verify the tiling looks correct.

How do I use the pattern on my website?

Copy the SVG code and use it as a CSS background-image via a data URI, or download the SVG file and reference it in your stylesheet. The tool generates the CSS snippet for you.

Can I customise the colours?

Yes. Pick a foreground and background colour using the colour pickers. The preview updates in real time as you adjust them.

What file format is the output?

Pure SVG, which is resolution-independent and has a tiny file size compared to raster patterns. SVG patterns scale perfectly to any screen size or DPI.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/svg-pattern-generator/" title="SVG Pattern Generator - Free Online Tool">Try SVG Pattern Generator on ToolboxKit.io</a>