Geolocation Mock Generator
Generate deterministic, reproducible mock geolocation data and routes for testing. A named seed makes every coordinate and route identical across runs and shareable via URL. Pick a city preset, custom point, or seeded-random location, add seeded jitter or a walking route, then export a browser navigator override, Playwright or Puppeteer test, raw JSON, or GeoJSON.
About this ToolHow it works, benefits & use casesTap to collapse
Mocking the browser Geolocation API by hand is fiddly, and most generators just paste a single hard-coded coordinate. This one is built around a seeded generator: a named seed makes every coordinate, jitter offset, and route point deterministic, so the same seed always produces the exact same output. That means you can commit a fixture, paste a shareable URL into a ticket, or write a test that asserts precise values and get identical results every run. Start from one of 20 real city presets (New York, London, Tokyo, San Francisco, and more), enter custom latitude and longitude, or let the seed scatter a random valid point. Add a seeded jitter radius to wobble the fix realistically, set accuracy, and optionally include altitude, heading, and speed. Switch to route mode to walk a seeded track of N points with a fixed time interval and step distance, complete with a live plotted polyline and a Haversine total-distance readout. Then export to whatever you need: a browser navigator.geolocation override (single fix or stepping watchPosition route), a Playwright test using context.setGeolocation and grantPermissions, a Puppeteer page.setGeolocation script, raw JSON in GeolocationPosition shape, or a GeoJSON Point/LineString. The whole configuration lives in the URL.
How to Use
- 1Type a Seed (any text) — it drives every coordinate, so the same seed always yields the same data.
- 2Pick a Base location: a city preset, Custom coordinates (enter lat/lng), or Random from the seed.
- 3Set Accuracy and an optional Jitter radius in meters, and toggle altitude, heading, or speed if you need them.
- 4Switch Mode to Route to build a seeded walking track, then tune the point count, interval, and step distance.
- 5Choose an Output target (navigator mock, Playwright, Puppeteer, JSON, or GeoJSON) and copy, download, share, or pipe the result.
Key Benefits
- Seeded and fully reproducible: the same seed always produces identical coordinates and routes
- 20 real city presets, custom lat/lng entry, and a seeded-random base point
- Seeded jitter radius wobbles the fix realistically without losing reproducibility
- Route mode generates a seeded multi-point track with a live plotted polyline and Haversine distance
- Five export targets: browser navigator override, Playwright, Puppeteer, JSON, and GeoJSON
- Optional altitude, heading, and speed on the coords object
- Shareable URL plus pipe-to support, with a correctly named file per target (geolocation.js, .spec.ts, .geojson, etc.)
Common Use Cases
- Writing a Playwright or Puppeteer test that needs a stable, asserted geolocation fix
- Mocking navigator.geolocation in the browser to debug a map or check-in feature
- Simulating a moving user with a seeded route to test watchPosition handlers
- Producing a GeoJSON LineString to drop into a map preview or fixture
- Sharing a reproducible location setup with a teammate via a single URL
Seed consolelog — same seed, same coordinates.
Position
Any text — drives reproducibility
Base: 37.774900, -122.419400
Signal
Copy, download, share, or pipe to another tool
// Mock navigator.geolocation with a fixed position (seed: consolelog)
const mockPosition = {
coords: {
latitude: 37.7749,
longitude: -122.4194,
accuracy: 18.592099,
altitude: null,
altitudeAccuracy: null,
heading: null,
speed: null,
},
timestamp: Date.now(),
};
navigator.geolocation.getCurrentPosition = function (success) {
success(mockPosition);
};
navigator.geolocation.watchPosition = function (success) {
success(mockPosition);
return 1; // mock watch id
};
navigator.geolocation.clearWatch = function () {};
console.log('Geolocation mocked with:', mockPosition.coords);
Reproducible by design
Unlike most geolocation mockers, this one is built on a seeded generator. The same seed always produces the same coordinates, jitter, and route — so you can commit a fixture, share a URL, or write a test that asserts exact values and get identical output every time. Hit Regenerate for a fresh, equally-stable point.
Single points or full routes
Drop a fixed position with optional seeded jitter, or build a seeded walking route with N points and a fixed time interval. Export a browser navigator.geolocation override, a Playwright or Puppeteer test, raw JSON, or a GeoJSON Point/LineString.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- JavaScript FormatterFormat and beautify JavaScript code
- SVG to React ComponentConvert SVG to a clean TSX/JSX/React Native component — currentColor, prop spread, forwardRef, memo, live preview
- App Icon GeneratorTurn one image into complete icon sets for iOS, Android, Web/PWA & macOS — Contents.json, adaptive icons, maskable, manifest & favicon.ico — in one ZIP
- Chrome Extension Manifest GeneratorBuild a valid manifest.json (V3 or V2) with a permission picker, a live install-warning preview that mirrors Chrome’s consent dialog, validation, and a runnable starter-project ZIP
- Package.json GeneratorBuild a complete package.json with framework presets, scripts, deps, exports map, engines, and live validation
- Fake Address GeneratorReproducible, multi-locale fake addresses with validation and map links; export JSON, CSV, SQL, or TypeScript
Everything random in the tool. The seed feeds a local deterministic pseudo-random generator, so the seeded-random base point, the jitter offset applied to a fixed location, the per-point accuracy variation, and the entire shape of a route are all derived from it. Type the same seed and you get byte-for-byte identical output every time — which is exactly what you want for a committed test fixture. Hit Regenerate (or change the seed text) for a fresh but equally stable set.
Five. The browser navigator mock overrides navigator.geolocation.getCurrentPosition, watchPosition, and clearWatch (in route mode, watchPosition steps through the points on your interval). Playwright produces a test that calls context.grantPermissions and context.setGeolocation. Puppeteer produces a script using page.setGeolocation with overridePermissions. JSON emits a raw GeolocationPosition-shaped object (or array for a route). GeoJSON emits a Point for a single position or a LineString for a route.

