Grid Path Distance Calculator
Compare Manhattan, diagonal-grid and straight-line distance between grid cells.
Your inputs
Calculation results
Formula & assumptions
Manhattan = dx+dy; eight-way steps = max(dx,dy); weighted diagonal path uses √2 diagonal cost.
Values use the specified units. Calculations use floating-point arithmetic. Check input measurements and formula assumptions before applying the result.
Compare your scenarios
Save up to five results to compare changes side by side. Scenarios stay in this tab until you clear or reload it.
Using Grid Path Distance Calculator
Compare Manhattan, diagonal-grid and straight-line distance between grid cells.
- Enter start x, start y, end x, end y using the units printed under each field.
- Choose Calculate, or enable live updates. Review the result labels and formula assumptions.
- Save scenarios to compare up to five variations, then copy the report or download JSON or CSV.
Example
Start X: 0 cells Start Y: 0 cells End X: 7 cells End Y: 4 cells Four-way moves: 11 Eight-way moves: 7 Weighted diagonal distance: 8.6568542 Straight-line distance: 8.0622577
Questions & answers
What does Grid Path Distance Calculator calculate?
Compare Manhattan, diagonal-grid and straight-line distance between grid cells.
Which units should I enter?
Start X uses cells. Start Y uses cells. End X uses cells. End Y uses cells. Convert values to these units before calculating.
Which formula does it use?
Manhattan = dx+dy; eight-way steps = max(dx,dy); weighted diagonal path uses √2 diagonal cost.
What does the included example show?
Start X: 0 cells; Start Y: 0 cells; End X: 7 cells; End Y: 4 cells. Result: Four-way moves = 11; Eight-way moves = 7; Weighted diagonal distance = 8.6568542; Straight-line distance = 8.0622577.
Can I compare different settings?
Yes. Save a scenario, change the inputs and save another result. Up to five scenarios are compared in this tab; they disappear when you reload or leave.
Can I export the calculation?
Copy the JSON report or download JSON and CSV with inputs, result labels and numeric values. Processing uses local JavaScript; no calculation request is sent to our server. Displayed values use up to 10 significant digits; exports retain JavaScript numeric precision.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
