Sprite Sheet Coordinate Generator
Enter your sprite sheet dimensions and sprite size to auto-calculate every sprite's pixel coordinates. Preview the grid layout and export CSS, JS object, JSON, Phaser 3, or Canvas code.
Frequently Asked Questions
What is a sprite sheet and why use one?▼
A sprite sheet (or texture atlas) packs multiple images into a single file. Instead of loading 50 separate images, you load one and use CSS background-position or canvas drawImage offsets to show specific parts. This reduces HTTP requests, improves load times, and allows the GPU to batch draw calls efficiently — critical for games and interactive UIs with many animated elements.
What is the difference between spacing and padding?▼
Padding is the gap between the sheet edge and the first sprite (also called 'margin'). Spacing (also called 'extrude' or 'inner padding') is the gap between adjacent sprites. Spacing prevents texture bleeding — when GPU bilinear filtering samples pixels from a neighboring sprite causing color artifacts at sprite edges. 1-2px spacing is enough for most cases.
What is texture bleeding and how does spacing fix it?▼
Texture bleeding occurs when GPU filtering reads texels (texture pixels) from adjacent sprites. At exact pixel boundaries with bilinear filtering, the GPU averages 2-4 neighboring pixels — including pixels from the wrong sprite. Adding 1-2px spacing (empty pixels between sprites) or 1px extrude (duplicating the sprite edge outward) prevents this sampling from crossing into neighboring sprites.
How does CSS background-position work with sprite sheets?▼
Set the element's background-image to the sprite sheet URL and background-size to the sheet dimensions. Then use background-position: -Xpx -Ypx to 'shift' the sheet so the desired sprite aligns to the element. Negative values move the sheet left/up, revealing the sprite at position (X, Y). Set the element width/height to the sprite dimensions.
What is JSON TexturePacker format?▼
TexturePacker is a popular sprite sheet tool. Its JSON format is widely supported by Phaser, PixiJS, Cocos2d, and other game engines. Each frame entry contains: frame (x, y, w, h — the source rect in the sheet), sourceSize (original image dimensions), rotated, and trimmed flags. Engines load this JSON alongside the sheet image to know where each named frame lives.
How do I use sprite sheets in Phaser 3?▼
Use this.load.spritesheet() in preload to load a uniformly-gridded sheet (all frames same size, optional spacing and margin). Use this.load.atlas() with a JSON file for irregular/packed sheets. Access frames with this.add.sprite(x, y, 'key', frameIndex). Create animations with this.anims.create() specifying frame ranges. Phaser calculates offsets automatically from your config.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
CSS Specificity Calculator
Calculate CSS selector specificity as (inline, ID, class, element) notation. Compare two selectors to see which wins the cascade. Supports :not(), :is(), :has(), :where(), attribute selectors, and pseudo-elements.
Open free tool →
CSS Clip-Path Generator
Generate CSS clip-path values visually. Choose from 16 polygon presets (triangle, star, arrow, hexagon), circle, ellipse, and inset shapes. Live preview, one-click copy. Free, no signup.
Open free tool →
CSS Formatter & Minifier
Format and beautify CSS with consistent indentation, or minify it to reduce file size. Handles @media, @keyframes, nested rules, and comments. Runs in your browser.
Open free tool →
More Free Tools
Related Articles
CSS Grid vs Flexbox: Complete Guide with Interactive Examples 2025
CSS Grid vs Flexbox with real code examples for every common layout pattern. Holy Grail layout, card grid, navigation bar, sidebar — see exactly when to use each one.
CSS Container Queries: The Complete Guide for Modern Web Development (2026)
Master CSS container queries including @container, container-type, container-name, style queries, size queries, and how to build truly responsive components without media queries.
Tailwind CSS v4: Everything Changed (Migration Guide 2026)
Complete guide to migrating from Tailwind CSS v3 to v4. CSS-first configuration, new utility classes, and step-by-step migration checklist.
CSS View Transitions API: Smooth Page Animations Without JavaScript Frameworks 2026
The View Transitions API enables fluid page animations and shared element transitions natively in the browser — no React Spring, Framer Motion, or animation libraries required. Complete guide with real-world examples for 2026.
Tailwind CSS v4: What's New and How to Migrate - Complete 2026 Guide
Everything you need to know about Tailwind CSS v4: new features, CSS variables approach, performance improvements, and a step-by-step migration guide from v3.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →