Merge GeoJSON files
Combine any number of GeoJSON documents into a single FeatureCollection. Open several files at once, or paste them one after another — mixed shapes are fine, and each feature can be tagged with the document it came from.
Merge GeoJSON files
What this tool does
It reads a stream of JSON values — several documents pasted back to back, one per line, or a set of files you opened together — and concatenates their features into one collection. FeatureCollection, single Feature and bare geometry inputs can be mixed freely; geometries are wrapped into features so everything ends up in the same list.
The intent it closes: "I have one file per region and the map needs one layer." It also covers the reverse of a split: exports from different tools, one file per day, or a folder of geometries downloaded separately.
How this tool works
A tolerant reader, then a straight concatenation.
1. Split the input into documents
Rather than requiring a separator, the input is scanned as a stream of JSON values: braces and brackets are counted (ignoring anything inside strings) so each complete document is found on its own. Newline-delimited GeoJSON therefore works too, as does a file that was concatenated with no delimiter at all. A chunk that fails to parse is counted and reported, and the rest still merge.
2. Collect the features
Each document contributes its features in order, with properties copied and any id preserved. With tag with _source on, every feature gains a _source property holding the 1-based index of the document it came from — the quickest way to see later which file a shape came from. With drop duplicates on, a feature whose geometry and properties exactly match one already kept is skipped.
3. Emit one collection
The result is a single FeatureCollection. Ticking add bbox computes the combined extent and writes it as the top-level bbox member, which some consumers use to set the initial map view without reading every coordinate.
Options
tag with _source
Adds a _source property numbering the input documents in the order they appeared. Useful when the merged layer needs to be styled or filtered by origin afterwards — the filter tool can then split it back out.
drop duplicates
Compares the exact JSON of geometry plus properties. It catches genuine re-exports of the same feature; it will not catch two features that describe the same place with different coordinate precision or different attribute spellings.
add bbox
Writes the combined extent as a four-element bbox member per RFC 7946 §5. Harmless to include, and useful for consumers that want the extent without a full scan.
Example
Input — two documents pasted one after the other:
{"type":"FeatureCollection","features":[
{"type":"Feature","properties":{"n":1},"geometry":{"type":"Point","coordinates":[0,0]}}
]}
{"type":"Feature","properties":{"n":2},"geometry":{"type":"Point","coordinates":[1,1]}}
Output, with tag with _source on:
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "n": 1, "_source": 1 }, "geometry": { "type": "Point", "coordinates": [0, 0] } },
{ "type": "Feature", "properties": { "n": 2, "_source": 2 }, "geometry": { "type": "Point", "coordinates": [1, 1] } }
]
}
The second document was a bare Feature rather than a collection, and it merged just the same. A bare geometry would have been wrapped in a feature with empty properties.
Tips & common pitfalls
- Property schemas do not have to match. Features keep their own keys, so a merged collection can be ragged. Most renderers cope; if a consumer needs a fixed schema, check the result with stats, which lists each key and how many features have it.
- Mind the total size. Merging is the step where a set of comfortable files becomes one uncomfortable one. Round the coordinates or simplify afterwards if the result is heading for a web map.
- Foreign members on the input collections are not carried over. Only features are merged; a top-level
nameorcrson one of the inputs is dropped. - Everything must be WGS 84. Merging files in different coordinate systems produces a document that renders as nonsense. Reproject first if one of them is in metres.
FAQ
How do I merge several files?
Use the file input and select them all at once — each file's text is appended to the input pane and the merge runs automatically. Dropping files one at a time replaces the pane contents, so multi-select is the way to go.
Do the documents need a separator?
No. The reader finds each complete JSON value by counting brackets, so documents pasted back to back, separated by blank lines, or one per line all work.
What happens to duplicate ids?
Nothing — id values are copied as-is and duplicates are allowed by the spec. Turn on drop duplicates if you want identical features collapsed, which compares the whole feature rather than just the id.
Is my data uploaded?
No. Files are read with the browser's FileReader and merged in the page.