Toolvito

Works on this device

Camera Orthographic Size Calculator

Find the orthographic size of a 2D camera from the screen height and the pixels per unit of your sprites, or the area a size shows. The page also checks that each art pixel is drawn as the same whole number of screen pixels.

Enter your values

Use this for pixel art: from the screen height, the pixels per unit and a whole-number zoom.

Your values

The width of the game view or the screen, in pixels.

The height of the game view or the screen, in pixels.

How many art pixels make one world unit. In Unity it is the Pixels Per Unit of the sprite import settings.

1 shows the art at its own size. 3 shows each art pixel as 3 × 3 screen pixels.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Choose what you want to work out, for example Orthographic size for pixel-perfect art.
  2. Type the screen size in pixels and the pixels per unit (PPU) of your sprites.
  3. Choose Calculate. The result shows the size, the visible area in world units and the working.

The formulas

This page uses Unity's convention: the orthographic size is half the height that the camera shows, in world units. Other engines may use the whole height, the width or a zoom number; check your engine.

  • Visible height = 2 × size. Visible width = visible height × screen width ÷ screen height.
  • Pixel-perfect size = screen height ÷ (2 × PPU × zoom), where zoom is a whole number: each art pixel is then zoom × zoom screen pixels.
  • Size that fits a width = world width × screen height ÷ (2 × screen width). Size that fits a height = world height ÷ 2.
  • Whole-number zoom for art drawn for a small screen = the smaller of screen width ÷ art width and screen height ÷ art height, rounded down.
  • All values are worked out with exact fractions from the digits you type. A size that does not end as a decimal is shown with its fraction.

Worked example

A screen of 1920 × 1080 pixels and sprites of 16 pixels per unit. At zoom 1 the size is 1080 ÷ (2 × 16 × 1) = 33.75 units, and the camera shows 120 × 67.5 units. At zoom 3 the size is 1080 ÷ (2 × 16 × 3) = 11.25 units, and the camera shows 40 × 22.5 units.

Art drawn for 320 × 180 pixels on the same screen: 1920 ÷ 320 = 6 and 1080 ÷ 180 = 6, so the zoom is 6 and the size is 1080 ÷ (2 × 16 × 6) = 5.625 units.

Limits you should know

  • The page does the arithmetic of the camera only. It does not read your project, and it does not know the settings of any engine.
  • A pixel-perfect size keeps the art sharp only when the camera and the sprites also sit on whole art pixels. Filtering, compression and the import settings of the sprites matter too.
  • The size is for a camera that shows the whole screen. A camera that draws to a part of the screen uses the height of that part.

Related tools