1001Ferramentas
🌍Generators

Random Coordinate Generator

Generate random geographic coordinates (latitude and longitude) — globally valid or country-restricted. Useful for map fixtures and simulations.


  

Random geographic coordinates explained

A random coordinate generator emits pairs of latitude and longitude that can be plotted on any map. The tool is used to seed map widgets in QA, scatter points-of-interest in mock data, run Monte-Carlo experiments on geospatial models, sample tiles for ML training on satellite imagery and even power location-based games. The selector above limits the output to the world, Brazil, Portugal or the United States.

Latitude, longitude and reference systems

Latitude measures the angle north (positive) or south (negative) of the Equator and runs from -90° to +90° — these are the parallels. Longitude measures the angle east (positive) or west (negative) of the Greenwich meridian and runs from -180° to +180° — the meridians. The Equator is latitude 0; Greenwich is longitude 0.

Coordinates are tied to a geodetic datum — a model of Earth's shape:

  • WGS84 (EPSG:4326) — the GPS standard, used by every consumer mapping API.
  • SIRGAS2000 — the official Brazilian system since 2015, compatible with WGS84 within centimetres.
  • SAD69 — the previous Brazilian datum, offset from WGS84 by roughly 60 m. Old cadastre data still uses it.

Decimal degrees vs DMS

Two formats coexist: decimal degrees (e.g. -23.5505) and Degrees-Minutes-Seconds (DMS, e.g. 23°33'01.8"S). Conversion: integer part = degrees, fractional part × 60 = minutes, fractional part of that × 60 = seconds. Decimal precision rule of thumb:

  • 4 decimals ≈ 11 metres — building level
  • 5 decimals ≈ 1 metre — tree level
  • 6 decimals ≈ 10 centimetres — commercial GPS limit

Haversine and uniform sampling on a sphere

To compute the great-circle distance between two coordinates, use the Haversine formula:

a = sin²(Δφ/2) + cos(φ1)·cos(φ2)·sin²(Δλ/2)
c = 2·atan2(√a, √(1−a))
d = R·c          // R = 6,371 km

A subtle bug: sampling latitude and longitude uniformly in their numeric ranges crowds points at the poles, because parallels at high latitude cover less surface area. To draw a truly uniform point on the globe, use:

lat = asin(2·U1 − 1) · 180/π
lng = U2 · 360 − 180
// where U1, U2 ∈ [0, 1]

Limiting the output to land only requires an extra step: rejection sampling against a raster land mask. Without a mask, roughly 71% of generated points fall in the ocean (Earth's water-to-land ratio).

FAQ

Can I restrict the output to Brazil? Yes — the selector at the top includes Brazil, Portugal, the United States and worldwide modes. The country presets use a bounding box around the territory; for the truly contoured polygon you'd need GeoJSON masking.

Will the points land on terra firma or in the sea? It depends on the mode. Without a land mask, roughly 70% of worldwide points fall on water. Country modes are more land-heavy but still hit lakes, bays and the Amazon basin's flooded forests.

What precision should I expect? Google Maps coordinates and the GPS in a smartphone deliver about ±3-10 m in outdoor conditions, ±20-50 m near tall buildings. Survey-grade RTK GNSS reaches the centimetre. The output of this generator uses 4-6 decimals, suitable for any consumer mapping use.

Which datum does the output use? WGS84 / SIRGAS2000 — interchangeable for any consumer mapping (Leaflet, Mapbox, Google Maps, OpenStreetMap). Do not feed the raw output into old SAD69 cadastre tools without a transformation.

Related Tools