Works on this device
Isometric Coordinate Calculator
Work out where a diamond tile is drawn on the screen, which tile is under a screen point such as the mouse, how large a whole map is, and the angle of your tiles. The formulas and the working are shown.
Enter your values
Check these values
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.
Your result
How it was worked out
How to use this calculator
- Choose what you want to work out, for example Screen position to tile.
- Type the tile width and height in pixels, then the column and row, or the screen position.
- Under More options, set where the top corner of tile 0, 0 is on the screen, if it is not at 0, 0.
- Choose Calculate. The result shows the values and the steps.
The formulas
Columns run down to the right and rows down to the left; screen y grows downwards. W and H are the tile width and height, and ox, oy the top corner of tile 0, 0.
- Tile to screen (top corner of the tile): x = ox + (column − row) × W ÷ 2, and y = oy + (column + row) × H ÷ 2. The centre is H ÷ 2 lower.
- Screen to tile: a = (x − ox) ÷ (W ÷ 2) and b = (y − oy) ÷ (H ÷ 2). Then column = (a + b) ÷ 2 and row = (b − a) ÷ 2, each rounded down to a whole tile.
- Map size: (columns + rows) × W ÷ 2 wide and (columns + rows) × H ÷ 2 high, with the top corner of tile 0, 0 at x = rows × W ÷ 2.
- Edge angle = atan(H ÷ W): about 26.57° for 2:1 tiles, and 30° for true isometric tiles, whose height is W × tan 30°.
Worked example
Tiles of 64 × 32 pixels. Tile 3, 2 has its top corner at x = (3 − 2) × 32 = 32 and y = (3 + 2) × 16 = 80, and its centre at 32, 96.
The screen point 20, 100: a = 20 ÷ 32 = 0.625 and b = 100 ÷ 16 = 6.25. Column = (0.625 + 6.25) ÷ 2 = 3.4375 and row = (6.25 − 0.625) ÷ 2 = 2.8125, so the point is on tile 3, 2.
A map of 10 columns and 8 rows is (10 + 8) × 32 = 576 pixels wide and (10 + 8) × 16 = 288 pixels high.
Limits you should know
- This page is for diamond maps. Staggered maps (every second row moved by half a tile) and hexagonal maps use other formulas.
- A tile image that is taller than its diamond, such as a wall, is drawn above the top corner. Picking by the diamond still uses the floor of the tile.
- A point raised by a height is drawn that many pixels higher on the screen. Subtract the height from y before you look up the tile on the floor.