I recently launched CityDistance.io, a free geography tool built around one simple question:
If a city is 500 km from Paris and 800 km from Berlin, which city could it be?
Most map tools are great at answering “how far is A from B?”
CityDistance is designed for the reverse problem: finding possible cities from distance clues.
Why I Built It
I enjoy geography games like Satle, SatZoom, UnZoomed, Citydle, Worldle, and GeoGuessr-style challenges.
A common pattern in these games is that after each guess, you receive a distance hint. That hint is useful, but one distance alone still leaves a huge circle of possible answers.
With two or three hints, though, you can triangulate the likely location.
That is the main idea behind CityDistance.io.
What CityDistance Does
The core tool lets you:
- Select 2 or 3 known cities
- Enter distance hints in kilometers, miles, or nautical miles
- Draw distance rings on an interactive map
- Find matching cities near the intersection area
- Share the result with others
It is useful for geography games, but also for teaching, spatial reasoning, and exploring how cities relate to each other around the world.
The current database includes 30,000+ cities worldwide, with search support for major cities and alternate names.
How the Calculation Works
CityDistance uses great-circle distance rather than flat map distance.
That means the distance follows the curvature of the Earth, which is much more accurate for global city-to-city comparison.
The calculation is based on the Haversine formula, then the app compares candidate cities against the distance constraints entered by the user.
In practice:
- Each reference city creates a distance circle.
- Two circles usually create two possible regions.
- A third reference city helps narrow the answer.
- Matching cities are ranked and shown on the map.
This is especially helpful because game hints are often rounded, so the tool allows some tolerance instead of expecting perfect mathematical input.
More Than a Calculator
CityDistance has grown beyond the original triangulation tool.
Radius Map Tool
The City radius tool lets you pick a city and find other cities within a chosen distance.
For example:
- Cities within 500 km of London
- Cities within 1,000 miles of New York
- Cities within 2,000 km of Shanghai
It visualizes the radius on the map and lists nearby cities.
City Distance Directory
The cities section is a growing directory of city pages and city-pair distance content.
It is designed for people searching things like:
- Distance from New York to Paris
- Cities near Tokyo
- Major cities within a certain range
- Great-circle distance between world cities
Geography Distance Quizzes
I also added a quiz hub with several modes:
- Daily distance challenge
- Distance guessing game
- City distance quiz
The goal is to help users build real geographic intuition, not just look up numbers.
Tech Stack
The site is built with:
- Astro
- Tailwind CSS
- MapLibre GL
- Turf.js
Astro works well here because many pages are content-heavy and benefit from fast static rendering, while the calculator and map tools still provide interactive client-side behavior where needed.
Design Direction
The visual style is intentionally practical and map-focused:
- Blue for water / Earth / primary actions
- Green for land / geography context
- Orange for calls to action
- Clean cards and panels
- Interactive map as the main working surface
I wanted the product to feel less like a landing page and more like a tool you can immediately use.
Try It
You can try the project here:
If you like geography games, try entering two distance hints from recent guesses and see how quickly the map narrows the answer.
I would love feedback from developers, geography game players, teachers, and anyone who enjoys map-based tools.
Top comments (0)