Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To open decimal latitude and longitude in a map, put the coordinates in latitude,longitude order and build a service-specific HTTPS URL. In JavaScript, use URL and URLSearchParams for query parameters; Google Maps also requires api=1, while OpenStreetMap uses a map fragment for its zoom and center.

Coordinate order and validation

Use latitude first and longitude second. For example, 37.422 and -122.084 represent a point north of the equator and west of the prime meridian. Keep the minus signs: they indicate southern latitudes and western longitudes.

Before creating a link, check that both values are finite numbers and within geographic bounds: latitude from -90 to 90, longitude from -180 to 180. These are coordinate bounds, not service-specific URL rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
function validateCoordinates(lat, lon) {
  if (!Number.isFinite(lat) || !Number.isFinite(lon)) {
    throw new TypeError("Latitude and longitude must be finite numbers.");
  }
  if (lat < -90 || lat > 90 || lon < -180 || lon > 180) {
    throw new RangeError("Coordinates are outside valid latitude/longitude bounds.");
  }
}

Build a Google Maps link

For a coordinate pin, use Google Maps’ search URL with api=1 and a query value containing latitude,longitude. Google says api=1 is required for every Maps URL request; without it, the parameters are ignored and the default map opens. Its documentation also says URLs are limited to 2,048 characters per request and advises proper encoding. Google Maps URLs documentation

#1 Best Overall
GlobalSat BU-353N USB GPS Receiver, Black, Made in Taiwan
  • Android supported (app required)
  • Built-In Roof Mount Magnet
  • 75-Channel All-In-View Trackin
  • GPS
  • newer version of BU-353-S4
function googleMapsUrl(lat, lon) {
  validateCoordinates(lat, lon);
  const url = new URL("https://www.google.com/maps/search/");
  url.searchParams.set("api", "1");
  url.searchParams.set("query", `${lat},${lon}`);
  return url.toString();
}

const url = googleMapsUrl(37.422, -122.084);
// https://www.google.com/maps/search/?api=1&query=37.422%2C-122.084

URLSearchParams encodes the comma as %2C. A coordinate-only search places a pin, but does not provide additional place information. If the link should identify a particular establishment, Google documents adding its known place ID with query_place_id alongside the query.

Use a route URL for directions

A search link shows a location; it is not a directions request. To request directions to the coordinates, use the /maps/dir/ path and destination parameter:

Rank #2
VFAN USB GPS Receiver Antenna Gmouse for Laptop PC Car Marine Navigation Magnetic Base
  • Built-in high-performance UBX-G7020KT multi-GNSS chip supports GPS, GLONASS, QZSS and SBAS, enabling fast and accurate positioning and obtain error-free NTP network time service. With official free GNSS software U-Center, it is easier to parsing the data of GPGGA, GPGLL, GPGSA, GPGSV, GPRMC, GPVTG and GPZD via PC, Laptop.
  • Compatible: Win 11/10/ Win 8/ Win 7/Vista/XP/CE. Free GNSS Evaluation Software. 56-Channel All-IN-VIEW Tracking. Working process: Menu-> Receiver->Port or SensorAPI to get data from GPS Receiver after instialled GNSS software (Software can be downloaded from CD-ROM and Official website)
  • Support OpenCPN, Kali Linux, Realtime Google-Earth Pro and maps. WIth the USB to type c converter, it fits Andriod phone/tablet. ( need to install GPS tools apps, like GNSS Master)
  • With a magnetic base, it is convenient for installation and fixation anywhere., High sensitivity and Strong Singal,Protocol: NMEA 0183, ASCII and TTL stardard. Customizd navigation rate 1-10 hz.
  • Cable Length 6.5 Ft / 2 Meters , IPX4 Water Resistance / Dust-tight. One-year after-sales service. Buy with confidence.
function googleDirectionsUrl(lat, lon) {
  validateCoordinates(lat, lon);
  const url = new URL("https://www.google.com/maps/dir/");
  url.searchParams.set("api", "1");
  url.searchParams.set("destination", `${lat},${lon}`);
  return url.toString();
}

You can omit an origin; Google may use a relevant current location or show a blank directions form. Google’s Maps URLs guide documents both URL forms.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build an Apple Maps link

Apple’s unified Maps URL documentation describes coordinate as a comma-separated latitude,longitude pair and supports coordinate-based map display and directions. The archived Map Links reference documents ll for the same pair; this simple map link uses that parameter:

Rank #3
HiLetgo VK172 G-Mouse USB GPS/GLONASS USB GPS Receiver for Windows 10/8/7/VISTA/XP
  • VK172 G-MOUSE USB GPS Receiver for Windows 10/8/7/VISTA/XP
  • VK172 G-MOUSE USB GPS/GLONASS USB GPS Receiver
  • Supported operating systems: Windows 10/8/7/Vista/XP/CE
  • Reference coordinate system: WGS-84
  • Tracking sensitivity:-162dBm
function appleMapsUrl(lat, lon) {
  validateCoordinates(lat, lon);
  const url = new URL("https://maps.apple.com/");
  url.searchParams.set("ll", `${lat},${lon}`);
  return url.toString();
}

Apple’s unified URL format also supports directions with source and destination, either of which may be a coordinate. Apple’s current documentation is the best reference for parameter details and presentation options; the relevant sources are Adopting unified Maps URLs and the archived Map Links reference.

Build an OpenStreetMap link with a marker

OpenStreetMap’s website accepts mlat and mlon query parameters for the red marker. Its #map=zoom/latitude/longitude fragment sets the zoom and map center. Use the same coordinates for both so the marker is centered:

Rank #4
VK-162 USB GPS Dongle - Remote Mount USB - External GPS Navigation Dongle - Supports Stratux, Raspberry Pi, Google Earth, Windows, Linux
  • MULTI-PLATFORM: Supports Stratux, Raspberry Pi, Google Earth, Windows, Linux
  • STRATUX READY: plug and play and supported by Stratux project.
  • LONG CORD: 7 ft. cord for remote mounting with magnetic base.
  • UPDATED CHIP: u-blox 7 chipset, WAAS capable.
  • DURABLE: IPX6 waterproof / dust-tight.
function openStreetMapUrl(lat, lon, zoom = 16) {
  validateCoordinates(lat, lon);
  if (!Number.isFinite(zoom) || zoom < 0) {
    throw new RangeError("Zoom must be a non-negative finite number.");
  }

  const url = new URL("https://www.openstreetmap.org/");
  url.searchParams.set("mlat", String(lat));
  url.searchParams.set("mlon", String(lon));
  url.hash = `map=${zoom}/${lat}/${lon}`;
  return url.toString();
}

The zoom value of 16 is an example default for this function, not a guarantee about the ideal scale for every location. OpenStreetMap’s Browsing documentation notes that a marker may fall outside the visible map area if the center differs, and cautions that support for some URL parameters may change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Put the generated URL in a clickable link

Render the returned URL as a normal HTTPS anchor. For example:

Best Value
Onyehn VK-162 USB GPS Navigation Antenna Module for GoogleEarth/WindowLinux
  • 🌟VK-162 GPS support for windows and for linux system, not for android and IOS system
  • 🌟The USB GPS is a great, easy, and an awesome solution for travelers.It works anywhere around the world. After you download the maps for the country traveling, it will pin point exactly where you are without having to pay any service.
  • 🌟For amateur radio operators who need accurate timing for digital communications, this is a unit that will help synchronize the timing for those modes.
  • 🌟This device is extremely accurate. It usually takes a couple of seconds to acquire the initial fix, followed up shortly by acquiring additional satellites for a more precise fix.
const mapsLink = document.createElement("a");
mapsLink.href = googleMapsUrl(37.422, -122.084);
mapsLink.textContent = "Open in Google Maps";
document.body.append(mapsLink);

Use equivalent link text for Apple Maps or OpenStreetMap. HTTPS links are broadly usable across devices, but do not guarantee that a particular installed app will open: the browser, operating system, user settings, and installed apps affect handoff. For a web page, prefer Google’s HTTPS Maps URLs over an app-only scheme when broad platform handling matters. Google documents custom URL schemes for iOS and recommends checking app availability before relying on them: Google Maps URL Scheme for iOS.

Service URL differences at a glance

Service Coordinate URL pattern What it does
Google Maps /maps/search/?api=1&query=LAT%2CLON Searches the coordinate and places a pin; coordinate-only search does not add place details.
Apple Maps https://maps.apple.com/?ll=LAT%2CLON Displays a coordinate-based map; Apple’s unified URLs also support coordinate directions.
OpenStreetMap /?mlat=LAT&mlon=LON#map=ZOOM/LAT/LON Shows a red marker and centers the map at the chosen zoom.

These links point to geographic coordinates, not necessarily to a named business or mapped feature. If users need to recognize a specific place, provide its name or a suitable place identifier as well as the coordinates.

Quick Recap

Bestseller No. 1
GlobalSat BU-353N USB GPS Receiver, Black, Made in Taiwan
GlobalSat BU-353N USB GPS Receiver, Black, Made in Taiwan
Android supported (app required); Built-In Roof Mount Magnet; 75-Channel All-In-View Trackin
$49.99
Bestseller No. 3
HiLetgo VK172 G-Mouse USB GPS/GLONASS USB GPS Receiver for Windows 10/8/7/VISTA/XP
HiLetgo VK172 G-Mouse USB GPS/GLONASS USB GPS Receiver for Windows 10/8/7/VISTA/XP
VK172 G-MOUSE USB GPS Receiver for Windows 10/8/7/VISTA/XP; VK172 G-MOUSE USB GPS/GLONASS USB GPS Receiver
$11.99
Bestseller No. 4
VK-162 USB GPS Dongle - Remote Mount USB - External GPS Navigation Dongle - Supports Stratux, Raspberry Pi, Google Earth, Windows, Linux
VK-162 USB GPS Dongle - Remote Mount USB - External GPS Navigation Dongle - Supports Stratux, Raspberry Pi, Google Earth, Windows, Linux
MULTI-PLATFORM: Supports Stratux, Raspberry Pi, Google Earth, Windows, Linux; STRATUX READY: plug and play and supported by Stratux project.
$16.97
Bestseller No. 5
Onyehn VK-162 USB GPS Navigation Antenna Module for GoogleEarth/WindowLinux
Onyehn VK-162 USB GPS Navigation Antenna Module for GoogleEarth/WindowLinux
🌟VK-162 GPS support for windows and for linux system, not for android and IOS system
$16.89

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.