Device & Sensors
Geolocation API
Retrieve device geographical location coordinates (latitude, longitude, accuracy).
Checking support...
Feature Not SupportedThis browser does not support the Geolocation API Web API feature. Try testing in a modern browser (such as Chrome, Edge, Safari, or Firefox).
Advertisement
Interactive Input Workspace
Ready for input
Web API Execution Output
Result output will be displayed here after processing...
Native JavaScript Code Example (Zero Libraries)
navigator.geolocation.getCurrentPosition((pos) => {
console.log(pos.coords.latitude, pos.coords.longitude);
});About the Geolocation API Web API
Geolocation API allows the user to provide their location to web applications.
Specification:W3C & WHATWG Web API Standard
Sponsored Content