Pixel Perfect Resolution Calculator for Godot 4
Pick your game's base resolution and the screens you care about to see, for each one, the largest whole-number scale, the size the game is drawn at, the black bars and how much of the screen is used. The calculator also lists base resolutions that fill 1080p, 1440p and 4K exactly, and writes the Godot 4 project.godot lines for pixel perfect integer scaling.
How to use it
- Pick a base resolution such as 320x180 or 640x360, or type a custom one, and press Next.
- Tick the displays to check, including Steam Deck and phones, or add a custom display. Press Next.
- Choose your Godot version, the viewport or canvas_items stretch mode, and keep or expand.
- Press Calculate scaling to see the scale, bars and screen use for every display.
- Press Copy project.godot lines and paste them into your project.
Why pixel art needs integer scaling
Pixel art looks right when every art pixel becomes the same number of screen pixels. At 3x, each pixel is a 3 by 3 block. At 2.5x, some pixels become 2 screen pixels wide and others 3, so lines wobble and shapes look uneven when the camera moves.
Integer scaling picks the largest whole-number scale that fits and fills the rest with black bars. A 320x180 game on a Steam Deck (1280x800) scales 4x to 1280x720 and leaves 40 pixel bars at the top and bottom. With stretch aspect set to expand, Godot shows a 320x200 view instead and fills the whole screen.
Godot's multiple resolutions guide says most pixel art games use viewport sizes between 256x224 and 640x480, and calls 640x360 a good baseline because it scales to 1280x720, 1920x1080, 2560x1440 and 3840x2160 without black bars when using integer scaling. 320x180 does the same at 4x, 6x, 8x and 12x.
Picking a base resolution
For 16:9 screens, a base resolution fills 1080p, 1440p and 4K exactly only if its height divides 1080, 1440 and 2160. 320x180 and 640x360 do; 384x216 and 480x270 fill 1080p and 4K but leave bars on 1440p, for example 384x216 scales 6x to 2304x1296 on a 2560x1440 screen with 128 pixel side bars.
Smaller bases mean bigger, chunkier pixels and less to draw; larger bases give more detail and room for UI text. Check the Steam Deck row as well: Valve recommends supporting its native 1280x800, and Steam Deck compatibility review asks that the smallest text is at least 9 pixels tall at 1280x800.
Phones vary the most. An iPhone 16 screen is 2556x1179 pixels, which a 320x180 game fills at 6x with 318 pixel side bars. With expand it shows a 390x180 view and the side bars shrink to 108 pixels. If you target phones, plan for expand and keep important UI away from the edges.
The Godot 4 settings
display/window/size/viewport_width and viewport_height set the base resolution. window_width_override and window_height_override set the starting window size on desktop, which the calculator picks as a whole multiple of the base that fits on a 1080p screen. They are ignored on iOS, Android and Web.
display/window/stretch/mode set to viewport renders at the base size and scales the finished image, which Godot recommends for pixel art. canvas_items draws 2D at the screen resolution and suits games that need smooth sub-pixel movement or sharp UI text. display/window/stretch/aspect set to keep adds black bars; expand shows more of the world instead.
display/window/stretch/scale_mode set to integer floors the scale to a whole number. It was added in Godot 4.2, so the calculator leaves it out for 4.0 and 4.1. rendering/textures/canvas_textures/default_texture_filter set to 0 (Nearest) keeps scaled sprites sharp. Projects created in Godot 4.7 or newer start with canvas_items and expand, so write the stretch lines out even if they look like defaults.
Frequently asked questions
What is the best resolution for pixel art games?
How do I make pixel art pixel perfect in Godot 4?
What resolution does the Steam Deck use?
Which Godot version added integer scaling?
Should I use viewport or canvas_items stretch mode for pixel art?
More free game dev tools
- Frame Time Calculator: Turn a target FPS into a millisecond budget per system, with Godot settings to match.
- Pixel Art Converter: Turn any image into pixel art with a set width and a reduced or retro palette.
- Sprite Sheet Slicer: Cut a sprite sheet into separate frame PNGs and a Godot SpriteFrames file, right in your browser.