Skip to main content
Vecaria

GeoJSON Centroid

Local

Compute one centroid for a whole GeoJSON file in your browser — free, no sign-up, nothing uploaded. Big lon/lat readout, one-click copy, map marker.

Sample data loaded — click "Compute centroid" to try it.

What is it? GeoJSON Centroid computes a single geometric centroid over the whole GeoJSON input (the mean of all vertices, not a population/attribute-weighted center), shows it as a big lon/lat readout with one-click copy, and marks it on a map.

TL;DR: Compute one geometric centroid for your whole GeoJSON in the browser — free with no sign-up, nothing uploaded. Read it as a big longitude/latitude readout with one-click copy, verify the point on the map, then download it.

How to use

  1. Paste your GeoJSON into the input box (a sample is pre-filled), or click "or load a file" to pick a .geojson/.json file.
  2. Click "Compute centroid" (or press Ctrl/Cmd+Enter).
  3. Read the centroid as a big lon/lat readout and copy it with one click; check the marker on the map preview ("Show original" compares with the input), then download the centroid GeoJSON.

FAQ

How is the centroid defined?

A single geometric centroid is computed over all input vertices (turf.centroid vertex mean) — not per feature, and not population-weighted.

Which coordinate order does the readout use?

Longitude first (lon, lat) — the GeoJSON coordinate order; a common mix-up when pasting into other tools.

What about features crossing the 180° antimeridian?

They are shifted into a continuous longitude space before the centroid is taken, and the result longitude is renormalized to ±180 — page shows a disclosure line when this applies.

Is it local?

Yes.

One centroid per feature, or one for the whole file?

One for the whole file. This tool computes a single centroid over all input vertices (their mean) — useful for "where is this layer roughly centered". If you need one centroid point per feature, run the tool once per feature, or use GeoJSON to CSV, which writes a centroid_lon / centroid_lat pair for each row.

Is it a center of mass, or area-weighted?

Neither. It is the plain geometric centroid — the mean of all vertices (turf.centroid) — so a densely detailed boundary pulls the point toward its vertices, and a polygon's centroid may even fall outside it. It is never weighted by population or attributes.

I need the center of the bounding box instead.

Use the GeoJSON Measure tool — it reports the bounding box for the whole input, and the box's center can sit far from the centroid for L-shaped or scattered data. This tool returns the vertex-mean centroid only.

Is it free? Do I need an account or to upload my file?

Free with the daily allowance, no sign-in, and nothing is uploaded — parsing and the centroid math run in your browser. Only the map preview's basemap tiles are fetched over the network; the geometry itself never leaves your device.

Examples

  • Paste features → get the centroid as a lon/lat readout (one-click copy) and a map marker

Supported formats

GeoJSON

Limitations

  • Output is a single centroid point for the whole input (turf.js (MIT) geometric centroid: mean of all vertices, not population/attribute-weighted).
  • Features crossing the ±180° antimeridian are shifted into continuous longitude space before computing, then the result longitude is renormalized to ±180 (spherical continuity approximated by shifting; a disclosure line appears when it applies).
  • Output stays in WGS84 longitude/latitude (RFC 7946 default — no crs member is written).
  • The readout and map preview are for verification: the readout is longitude-first (GeoJSON order); the preview renders geometry locally while CARTO basemap tiles are fetched over the network.
  • Runs locally in your browser; nothing is uploaded.

Privacy

Privacy first: this tool runs entirely in your browser — your input and files never leave your device, and everything is cleared when you close the page.