Mapshaper edits Shapefile, GeoJSON and TopoJSON from one command line, and hits a 2GB output wall
Tools for editing Shapefile, GeoJSON, TopoJSON and CSV files
At a glance
- What is it?
- A JavaScript tool for simplifying, clipping, dissolving and filtering map data, run from three command line programs or a browser page. The limits sit in memory and in single-file output size.
- Who is it for?
- Pick Mapshaper if your job is cleaning and reshaping vector files for maps: simplify, clip, dissolve, filter, and convert between Shapefile, GeoJSON, TopoJSON and CSV. Skip it for anything that must write one output file above 2GB, and skip the browser route for Chrome users with files of several hundred megabytes.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- mbloch/mapshaper4,212 ★ · +24
| Repository | 2026-10-08 | 2026-11-25 |
|---|---|---|
| mbloch/mapshaper | 4.2k | 4.2k |
24 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Three executables share one command language
Mapshaper ships three command line programs that run on Mac OS X, Linux and Windows. `mapshaper` runs mapshaper commands. `mapshaper-xl` behaves the same way but starts with more RAM so it can take larger files. `mapshaper-gui` serves the web interface from your own machine.
The work these programs do is the everyday cleanup of map data: simplifying shapes, editing attribute data, clipping, erasing, dissolving and filtering. Input and output formats include Shapefile, GeoJSON, TopoJSON, GeoTIFF and CSV. Check the format documentation for limitations: M and Z values are lost on Shapefile import, and large rasters may be reduced on import unless configured otherwise. The package.json keywords add cartography, simplification, topology and gis, which tells you the audience is people preparing maps rather than running spatial databases.
The command reference lives at mapshaper.org/docs/reference.html, and an introduction to the command line sits at mapshaper.org/docs/essentials/command-line.html. The README itself shows no editing command examples, so the first working invocation comes from those docs pages, not from the repository.
The npm install needs Node 20.11 and puts all three scripts on your path
Mapshaper requires Node.js. The package.json sets `engines.node` to `>=20.11.0`. The README tells you to install the release version globally with the -g flag, which is what makes the executable scripts available systemwide:
npm install -g mapshaperAfter that, `mapshaper`, `mapshaper-xl` and `mapshaper-gui` are all callable by name. Without the -g flag, the scripts stay inside a project folder and you would have to call them by path.
The cost of this route is the dependency tree. package.json lists packages such as `@ngageoint/geopackage`, `flatgeobuf`, `fontkit`, `@resvg/resvg-wasm` and `@bokuweb/zstd-wasm`, so a global install pulls in a good deal more than a Shapefile reader. The README says nothing about how to uninstall or pin an older release.
Building from master means a rollup bundle step before anything runs
The README gives a second route for anyone who wants the latest development code from GitHub:
git clone [email protected]:mbloch/mapshaper.git
cd mapshaper
npm install # install dependencies
npm run build # bundle source code files
npm link # (optional) add global symlinks so scripts are available systemwideThe build script in package.json is `rollup --config`, so the checkout is not runnable until the source files are bundled into `mapshaper.js`, the file named as `main`. Running `npm run build` builds both the command line and web UI modules. There is also `npm run dev`, which runs rollup in watch mode, and `npm test`, which runs mocha against the test folder.
The clone address uses SSH ([email protected]), so a machine without a GitHub SSH key cannot follow the README line as written. The repository also holds browser tests run through Playwright with `npm run test:browser`, but the README does not describe how to set those up.
Heap memory runs out before the 2GB output limit does
The README is direct about large files, and the command line interface has hard limits. The maximum output size of a single file of any type is 2GB. GeoJSON, CSV, .shp and .dbf are read incrementally, so much larger files than that can be imported. The mismatch is the trap: an input can load and then fail when you try to write it back as one file.
The more common failure is memory. With very large files, mapshaper may become unresponsive or crash with the message "JavaScript heap out of memory." The first fix is `mapshaper-xl`, which allocates 8GB of heap by default. You can ask for more:
mapshaper-xl 20gb [commands]The second fix is to run Node directly. The README's example, for Mac or Linux, allocates 16GB of heap memory:
node --max-old-space-size=16000 "$(command -v mapshaper)" input.shp -o output.geojsonThe example uses placeholder filenames; substitute your own input and output. Both routes need sufficient memory, and raising the heap limit does not remove the documented single-file output limit. The README gives no guidance on how much memory a given file size needs, so you find the number by trying.
The browser version keeps data local but depends on which browser opens it
Visit the public site at www.mapshaper.org or run the interface locally with the `mapshaper-gui` script. The project states that processing happens in the browser. For sensitive data, evaluate the deployed page, browser extensions and any network resources as well; local processing alone is not an unconditional privacy guarantee.
Browser choice changes what you can open. Firefox is able to load Shapefiles and GeoJSON files larger than 1GB. Chrome has improved in recent versions but is still prone to out-of-memory errors when importing files larger than several hundred megabytes. A reader with a file of several hundred megabytes and only Chrome may hit out-of-memory errors and can switch to Firefox or the command line.
The README lists support for recent desktop versions of Chrome, Firefox, Safari and Internet Explorer, and says Safari before v10.1 and IE before v10 are not supported. No phone or tablet support is mentioned. This is a desktop tool in the interactive form too.
Bun can stand in for Node, and R and Docker users have wrappers someone else maintains
Mapshaper's command line tools can be run with Bun as an alternative to Node.js. The simplest option is bunx:
bunx mapshaper [commands]That skips the global install entirely. The README does not say whether `mapshaper-xl` or `mapshaper-gui` work under Bun, so only the plain `mapshaper` program is covered.
Three outside resources are listed under user-contributed work. rmapshaper is an R package by Andy Teucher that gives R users access to many of mapshaper's editing commands, which means many, not all. A Docker image from Christian Weiss is on Docker Hub as freifunkhamm/mapshaper. Tutorials include a two part guide to command line cartography by Dylan Moriarty and an introduction by Jack Dougherty at handsondataviz.org/mapshaper.html.
None of these is maintained by the project itself. If the R wrapper lags behind the core, the README offers no way to know.
Releases land in bursts, with three tags between October 27 and 29
The repository is not archived. The last push was on 29 October 2026, and package.json reports version 0.7.101. The release list shows v0.7.99 on 27 October 2026, v0.7.100 later the same day and v0.7.101 on 29 October 2026. Three tags in about two days means the project is still moving fast, and also that a version you install this week may differ from the one a tutorial was written against.
The version number is still 0.7.x, and the README makes no stability promise. Pin the version in anything you automate, and read CHANGELOG.md, which sits at the top of the repository, before upgrading.
The license needs a second look. GitHub reports NOASSERTION, while the README and package.json both say MPL 2.0. The README quotes Mozilla's FAQ that the file-level copyleft encourages contributors to share modifications while still allowing combination with code under other licenses. If you plan to redistribute modified source files, read the MPL text yourself.
Funding comes from Ko-fi and GitHub Sponsors, and the README thanks colleagues at The New York Times and Mark Harrower for the original MapShaper program at the University of Wisconsin-Madison.
Documentation is published in a form that AI assistants can read
The README points AI assistants and other tools that read documentation at mapshaper.org/llms.txt, an llms.txt index of every docs page in machine-readable form. Each page is also available as Markdown by appending .md to its URL, for example mapshaper.org/docs/essentials/command-line.html.md. The full corpus in a single file is at mapshaper.org/llms-full.txt.
The package.json `files` list excludes `/www/docs/**`, `/www/llms*` and `/www/ai-config.js` from the published npm package. Installing from npm therefore gives you the programs and the web UI but not the docs, so the reference stays online at mapshaper.org.
Suggestions go in as GitHub issues. The README names no other support channel.
Editorial conclusion
Pick Mapshaper if your job is cleaning and reshaping vector files for maps: simplify, clip, dissolve, filter, and convert between Shapefile, GeoJSON, TopoJSON and CSV. Skip it for anything that must write one output file above 2GB, and skip the browser route for Chrome users with files of several hundred megabytes. Before adopting it, run your largest real input through mapshaper-xl and check the heap error does not appear.
Frequently asked questions
What is Mapshaper?
Mapshaper is software written in JavaScript for editing Shapefile, GeoJSON, TopoJSON, GeoTIFF, CSV and several other data formats. It supports map making tasks like simplifying shapes, editing attribute data, clipping, erasing, dissolving and filtering.
What does Mapshaper do?
It handles essential map making tasks such as simplifying shapes, editing attribute data, clipping, erasing, dissolving and filtering. It runs as three command line programs or as a web interface.
How does Mapshaper work?
Use `mapshaper` on the command line, `mapshaper-xl` with a larger heap for big jobs, or the browser interface. The project says processing is performed in the browser; for sensitive data, also assess the deployment, browser extensions and any external resources rather than treating local processing as an unconditional privacy guarantee.
How to use Mapshaper?
Install Node.js, then run npm install -g mapshaper to get the command line scripts, or visit www.mapshaper.org to use the web interface. The docs at mapshaper.org/docs/ include a command line introduction and a command reference.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/mbloch-mapshaper)Star history chart for your README
[](https://hysenlabs.com/projects/mbloch-mapshaper)Was this useful?