How the Feature Counter Works
This tool parses your GeoJSON and produces a breakdown of every feature and geometry it contains. It counts the total number of features, then groups them by geometry type — Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. The result is a JSON object showing the count for each geometry type that appears in your data, plus the total.
The counter operates on the top-level features array in a FeatureCollection. If you pass a single Feature or bare Geometry, it wraps it in a FeatureCollection first. Features with null geometries are included in the total count but do not appear in any geometry type category.
Why Count GeoJSON Features?
- Verify the expected number of records after an export or conversion
- Detect unexpected geometry types mixed into your dataset
- Estimate rendering cost before loading data into a web map
- Compare feature counts before and after spatial operations like merging or flattening
- Quality-check data pipelines that produce GeoJSON output
- Audit files before importing into PostGIS or other spatial databases
Understanding the Results
The output shows a JSON object with the total feature count and a per-type breakdown. If your data contains Multi-geometries and you need individual counts, use the flatten tool first to explode them into single geometries, then re-count.
For example, a FeatureCollection containing 3 MultiPolygons might flatten into 12 individual Polygons. The feature counter gives you both perspectives — the logical feature count (3 features) and, after flattening, the geometric primitive count (12 polygons).
Try It
Paste a FeatureCollection with mixed geometry types to see how the breakdown works. The tool instantly shows output like:
JSON{
"Point": 5,
"LineString": 2,
"Polygon": 3,
"Total": 10
}Only geometry types present in your data are shown. If all features are Points, you will see only the Point count and the Total.
Performance Considerations
Feature counting is fast — the tool only inspects the type field of each feature's geometry without traversing coordinate arrays. A file with 100,000 features counts in under 100 milliseconds. For very large files, the bottleneck is parsing the JSON, not the counting itself. If your browser struggles to parse the file, consider splitting it first using command-line tools like ogr2ogr or jq.
Related tools: GeoJSON viewer to visualize the features on a map, validator to check structural correctness, or bounding box calculator to find the spatial extent.