Qibla Direction Finder
The initial great-circle bearing and distance from a latitude and longitude to the Kaaba in Mecca.
What this Qibla Direction Finder does
The initial great-circle bearing and distance from a latitude and longitude to the Kaaba in Mecca.
The bearing is the great-circle initial bearing from your coordinates to 21.4225° N, 39.8262° E, computed with the standard atan2 form. It is measured clockwise from true north, so magnetic variation is not applied and a compass needle will differ by your local declination. The distance is the central angle times 6,371.0088 km.
How to use it
Enter Latitude (°), Longitude (°), then press Run. The page recalculates from the values on screen and prints the rule it applied.
Worked example
Input:
Latitude (°) = 51.5074
Longitude (°) = -0.1278
Output:
Bearing to Mecca = 119°
Compass point = ESE
Distance to Mecca = 4794 km
Rule = great-circle initial bearing, true north, no magnetic variation applied
Why it runs in your browser
This page runs entirely in this tab: no value is posted to a server, no cookie or storage entry is written, and reloading the page discards everything.
Qibla Direction Finder: The initial great-circle bearing and distance from a latitude and longitude to the Kaaba in Mecca.
The bearing is the great-circle initial bearing from your coordinates to 21.4225° N, 39.8262° E, computed with the standard atan2 form. It is measured clockwise from true north, so magnetic variation is not applied and a compass needle will differ by your local declination. The distance is the central angle times 6,371.0088 km.
Worked example: Latitude (°) = 51.5074, Longitude (°) = -0.1278 gives Bearing to Mecca = 119°; Compass point = ESE; Distance to Mecca = 4794 km; Rule = great-circle initial bearing, true north, no magnetic variation applied.
How to use the Qibla Direction Finder calculator
Enter Latitude (°), Longitude (°), then press Run. The page recalculates from the values on screen and prints the rule it applied.
This page runs entirely in this tab: no value is posted to a server, no cookie or storage entry is written, and reloading the page discards everything.
- Latitude (°) — a number
- Longitude (°) — a number
The rule this page applies
The bearing is the great-circle initial bearing from your coordinates to 21.4225° N, 39.8262° E, computed with the standard atan2 form. It is measured clockwise from true north, so magnetic variation is not applied and a compass needle will differ by your local declination. The distance is the central angle times 6,371.0088 km.
Static HTML and JavaScript only — the same source served to every visitor, with no network call and no server-side executor.
- Bearing to Mecca = 119°
- Compass point = ESE
- Distance to Mecca = 4794 km
- Rule = great-circle initial bearing, true north, no magnetic variation applied
What to Expect
Best for
- Getting the bearing to mecca quickly
- Checked arithmetic, printed with its rule
- Comparing two sets of inputs
Not ideal for
- Data this page does not carry
- A guarantee about the physical world
- Locales other than English
What this tool keeps
- Your inputs in this tab
- The rule, printed in full
- The same answer on every run
What may need cleanup
- A value the page refuses, which names the field instead of guessing
- A number outside the stated range, which is refused by name
Common errors
- A blank field is refused rather than read as zero
- A zero denominator is refused rather than printed as infinity
- A value outside the formula’s range is refused with the range named
Example use cases
- Checking a figure before you rely on it
- Homework and exam checking
- Comparing two options side by side
Sample input
Latitude (°) = 51.5074, Longitude (°) = -0.1278
Sample output
Bearing to Mecca = 119°; Compass point = ESE; Distance to Mecca = 4794 km; Rule = great-circle initial bearing, true north, no magnetic variation applied
Who this is for
- Anyone checking this figure by hand
- Students and teachers
Frequently asked questions
What does Qibla Direction Finder calculator do?
The initial great-circle bearing and distance from a latitude and longitude to the Kaaba in Mecca. It prints bearing to mecca, compass point, distance to mecca, rule.
How does this page work out the answer?
The bearing is the great-circle initial bearing from your coordinates to 21.4225° N, 39.8262° E, computed with the standard atan2 form. It is measured clockwise from true north, so magnetic variation is not applied and a compass needle will differ by your local declination. The distance is the central angle times 6,371.0088 km.
Is anything uploaded or stored?
This page runs entirely in this tab: no value is posted to a server, no cookie or storage entry is written, and reloading the page discards everything.
Which inputs does the page read?
It reads Latitude (°), Longitude (°). Every other value is derived from those.
Is the bearing magnetic or true?
True. A magnetic compass reads relative to magnetic north, which differs by your local declination, so you must correct the printed bearing for your position and year.
Why is the bearing to a place not the same as a straight line on a flat map?
Because the Earth is a sphere: the shortest path is a great circle, which curves on a flat projection. The initial bearing is the direction that path leaves your position.
What if I am in Mecca?
Within a kilometre of the Kaaba the direction has no meaning, so the page says so rather than printing an arbitrary angle.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.