This application reads a valid GeoJSON file and returns a valid GeoJSON file of centroids.
In the resulting file:
All properties are retained in the output file.
Polygon features become points that represent the Polygon's centroid.
LineString features become points that represent the middle of the LineString.
Point features do not change.
I have no idea how this handles MultiPolygons.
If you don't have a GeoJSON file, you can download an example file below. It has two simplified polygons: the state of Utah and the District of Columbia.