Pixel Grid Maker

Pixel Art to CSS & SVG Generator

Draw or drop a pixel art sprite and get copyable single-element CSS box-shadow code plus run-length merged crisp SVG markup—with zero server uploads.

Pure CSS box-shadow

Optimized Merged-Rect SVG

Draw on the left canvas or upload a sprite to inspect live CSS rendering and copy code.

Quick draw & import settings

Copy or download code

  • Single-div CSS box-shadow
  • Run-merged SVG optimizer
  • Live CSS preview
  • 16×16 mini editor
  • Zero dependencies
  • No sign-up

How to convert pixel art to CSS or SVG

  1. Draw or drop a sprite

    Paint directly on the 16×16 grid, upload a small PNG sprite, or send artwork straight from Pixel Art Maker.

  2. Tune CSS pixel scale

    Slide CSS pixel size (2 px–16 px) to scale the single-div box-shadow icon and watch the live CSS render update side by side.

  3. Inspect merged SVG savings

    Horizontal run-length merging combines adjacent identical pixels into single <rect> elements, typically shrinking SVG markup by 40%–75%.

  4. Copy or download code

    Copy pure CSS or SVG markup to your clipboard in one click, or download standalone .css and .svg files.

How pure CSS pixel art & merged SVG work

A pixel-art-to-CSS converter turns each non-transparent pixel coordinate (x, y) into an exact hard-edged box-shadow offset on a single HTML <div>, while the SVG optimizer merges horizontal runs of identical colors into compact <rect width="N" height="1"> elements tagged with shape-rendering="crispEdges".

CSS box-shadow vs. Merged SVG comparison

Output format Best sprite size File / DOM overhead Scales dynamically?
Pure CSS box-shadow 8×8 to 20×20 1 HTML <div> + CSS rule Fixed px unit (or CSS custom property)
Merged-Rect SVG 16×16 to 64×64 Inline <svg> or .svg file Scales infinitely with viewBox

Related developer & pixel tools

Last updated:

All 20 free browser pixel tools

Drawing, animation & pixel text

Bead, stitch & yarn craft charts

Minecraft & brick blueprints

Photo conversion & game dev utilities

Pixel art to CSS & SVG FAQ

How does single-div CSS pixel art work?

A single HTML element (such as <div class='pixel-art'></div>) gets a width and height of 1 pixel unit (for example 8px × 8px) and lists one offset comma-separated box-shadow per colored pixel with zero blur radius.

When should I pick SVG over CSS box-shadow?

Use CSS box-shadow for tiny 8×8 to 16×16 retro UI badges when you want zero extra HTTP requests or inline SVG tags. Use merged-rect SVG for larger 24×24 to 48×48 sprites because it compresses adjacent pixels and scales cleanly inside CSS or <img> tags.

Why does SVG need shape-rendering='crispEdges'?

Without shape-rendering='crispEdges', browsers anti-alias adjacent <rect> borders at fractional zoom levels, creating faint hairline seams between pixels.