How kmlviewer.app shows your map file without uploading it
The evidence behind the claims on the KML viewer: how a file is read, what is drawn and what is not, what each base map sends and to whom, how lengths and areas are worked out, the limits, and how to check that your file stays on your device.
Updated
How your file is read
A file you add is read by code that is already part of the page, in a background worker on your device, and its kind is decided by its contents, not its name: a ZIP archive is a KMZ, text that starts with { or [ is GeoJSON, and XML is KML or GPX by its root element. KML and GPX are parsed with the open-source libraries @xmldom/xmldom 0.9.12 and @tmcw/togeojson 7.1.4. A KMZ's list of files is read and checked by the viewer's own code, and each file is unpacked with fflate 0.8.3. Exports are written with @placemarkio/tokml 0.4.0 for KML and @mapbox/shp-write 0.4.3 for shapefiles, and ZIP files are made with fflate.
A file from a stranger could be made to do harm, so each one is checked before it is used. XML that declares a document type or entities is refused, so a file cannot make the parser expand text to an enormous size. A KMZ is refused before anything is unpacked if it lists more than 5,000 files, adds up to more than 500 MB unpacked by its own declared sizes, or names a path that leads outside the archive, and each file is checked against its declared size and checksum as it is unpacked. A file above 200 MB, one with more than 2,000,000 vertices, or one nested more than 100 elements deep (150 levels for GeoJSON) is refused. The message says what happened, for example "This map exceeds the file, geometry, or export size limit." or "The KMZ archive is damaged or has an unsafe path."
What is drawn, and what is not
The map is drawn with Leaflet 1.9.4 on a canvas. What the viewer does with each part of a file:
| In the file | What the viewer does |
|---|---|
Points, paths, polygons with their holes, multi-geometries and Google Earth tracks (gx:Track) | Drawn with the file's line color, width and opacity and its fill color and opacity |
| Folders | Listed as a tree with a tick box on each, starting shown or hidden as the file sets them |
| Icons packed inside a KMZ | Drawn on the map if they are PNG, JPEG, GIF, WebP or BMP pictures of up to 8,192 pixels on a side (a GIF shows its first frame); other icons are drawn as a dot |
| Icons at a web address | Not fetched: a dot in the style's color is drawn instead, and the line of facts counts them |
| Ground overlays (an image laid on the map) packed inside a KMZ | Drawn in place with their rotation, with an Overlay opacity slider |
| Ground overlay images at a web address | Not fetched: the panel lists the overlay with "Overlay image unavailable", and its address is counted |
Ground overlays placed by four corners (gx:LatLonQuad) | Not shown, and counted as unsupported items |
| Descriptions | Shown as text, paragraphs, line breaks, lists, tables, bold and italic; links as their text with an Open link button; images and frames not loaded, and counted |
| Data fields (ExtendedData and Schema data) and GPX fields | Shown in a table under Properties in the placemark's details |
| Altitudes | Kept in the data and used for the elevation figures; the map is flat and altitude modes are not read, so shapes are drawn at their positions on the ground |
| Network links | Not followed, and counted |
| 3D models, tours, photo overlays and screen overlays | Not shown, and counted |
No web address that a file names is fetched (network links, icons, overlay images, shared styles), because each request would tell that server that someone opened the file. In the panel, the line of facts under each file's name counts what was skipped and the remote icons, and a list under it gives every web address that was not loaded.
Why nothing in a description can run
A description is HTML written by whoever made the file, so it can hold a script or a link that runs code. In the background worker, parse5 8.1.1 reads the description and keeps only text, paragraphs, line breaks, lists, tables, bold and italic, and the addresses of http: and https: links. In the page, DOMPurify 3.4.18 cleans the result again, and the viewer builds the page elements itself from what is left. No attribute from the file reaches the page.
A link is shown as its text with an Open link button, which opens only http: and https: addresses, in a new tab, after you press it. A test opens a description holding a script, an event handler, a javascript: link, a remote image and a frame, and fails if any of them runs or loads.
The Outline map, and why it is the default
The Outline map is drawn in your browser from files that are part of this site: country borders and coastlines from Natural Earth, version 4.1.0 at a scale of 1:50 million, through the world-atlas 2.0.2 package, and dots for 12 large cities from a list in the site's own code, with their names once you zoom in one step from the first view. Natural Earth's data is in the public domain. Outline is the base map every time the viewer opens, even when you chose another one last time.
Because no part of this map comes from another server, it works offline, and opening a file on it tells nobody which part of the world the file covers. It is drawn at the scale of a world map, so close up it shows no roads or terrain; for those, choose a remote base map.
What a remote base map sends
The other base maps are pictures, called tiles, from another organization's server. None loads until you choose it, and each choice in the Base map menu names the server it will contact before you press it. While a remote map is on, a line under the map names its server (for Streets: "tile.openstreetmap.org will see the area on screen. The file stays on your device.") and has a Back to Outline button. Your choice is remembered in your browser, but on your next visit the viewer starts on Outline again and the line offers a button to turn the remembered map back on, so opening the site requests no tiles.
| Base map | Server | What it shows |
|---|---|---|
| Streets | tile.openstreetmap.org (OpenStreetMap Foundation) | OpenStreetMap's Standard map |
| Satellite (world) | tiles.maps.eox.at (EOX IT Services GmbH) | EOxCloudless 2016, a cloud-free picture of the world made from Copernicus Sentinel-2 satellite data |
| Satellite (United States) | basemap.nationalmap.gov (U.S. Geological Survey) | Aerial pictures at 1 meter per pixel for the lower 48 states, mostly from the USDA National Agriculture Imagery Program, and at 10 meters for Alaska |
| Topographic (United States) | basemap.nationalmap.gov (U.S. Geological Survey) | USGS Topo, a topographic map made from the data of The National Map and other public-domain data |
While a remote base map is on, your browser asks that server for the tiles that cover the area on your screen. Each request is an address made of the zoom level and the tile's row and column, so the server learns which part of the world you are looking at, and how closely. It also receives your IP address and your browser's user-agent string. Each tile request carries the site's origin, https://kmlviewer.app/, as its referrer, never the address of the page.
Not sent: your file, its name, the names, descriptions and data in it, and its exact coordinates. Tiles are requested only for the area on screen; the site does not download them ahead, and its offline copy never holds them. While a remote map is on, its credit line is shown at the bottom of the map, linked to the organization's page.
What each server keeps, and links to its own policies, are on the privacy page.
How lengths and areas are worked out
Lengths are measured along the surface of the Earth, taken as a sphere with a radius of 6,371,008.8 meters, the mean radius of the WGS 84 ellipsoid, with the haversine formula between each pair of points. On that sphere, one degree along the equator is 111.195 kilometers.
Areas are measured on the same sphere with the spherical ring formula of Chamberlain and Duquette, and the area of each hole is taken out of the polygon that has it.
For a line with an elevation at every point, ascent and descent are summed after each elevation is replaced by the middle value of itself and its two neighbors, and a rise or fall counts only once it reaches 3 meters, so small ups and downs in GPS readings are not counted as climbing. When every point carries a time, the total time runs from the first point to the last, and the moving time adds up the time between points only where the position changed; there is no speed threshold.
Figures are in US units (miles, feet, acres, square miles) or metric units (kilometers, meters, hectares, square kilometers), as the units button sets.
How it is tested
The engine has 34 tests, run in Node. They open 14 test files, written for the purpose or taken unchanged from togeojson's own tests: nested folders with one hidden, shared styles and a style map, ExtendedData and Schema data, a point, a path and a polygon with a hole, a description with HTML and a script, a KMZ with an icon and a ground overlay image, a KMZ whose KML sits in a folder and is not named doc.kml, a network link and a remote icon, a GPX file with a track, a route and a waypoint, a GeoJSON file, a Google Earth track, a multi-geometry, KML 2.1, a file with no namespace, and UTF-16 text with a byte order mark. Six damaged or hostile files must each give their error: an empty file, a text file that is not a map, a damaged KMZ, a KMZ with an entry named ../x, a KMZ that declares a 10 GB KML file, and a KML file that declares an XML entity. Other cases are made at test time: a ZIP that declares 5,001 entries, a path of 2,000,001 vertices and a line of 100,000.
Lengths, areas and track figures are checked against figures worked out by hand. The KML, KMZ, GPX and GeoJSON exports are opened again by the engine, and those four and the CSV are read by Python's own CSV, JSON or XML reader, which checks the names, the number of features or rows and the first coordinates. Shapefiles are read back by shpjs 6.2.0, a separate shapefile reader, which checks every record's name, kind of shape, first coordinates and data fields. The GeoJSON export of every test file must pass the viewer's own RFC 7946 check.
Browser tests open every test file in the page and check the list of placemarks; choose a placemark and read the map canvas to check that it is drawn in its color at the center of the map; and check the folder and file tick boxes, search, lengths, areas and the units button, a hostile description, all six exports (downloaded and read back), the three export scopes, a KMZ's icon and ground overlay with the opacity slider, offline use, pasted GeoJSON with errors, the elevation profile by pointer and keyboard, Copy coordinates, the list that is printed, 100,000 points, and the tile addresses and referrer of every remote base map.
Last tested: November 22, 2026. The 34 engine tests passed, and the 13 page tests passed in Chrome, Firefox and WebKit, the engine of Safari.
Known limits
A file can be up to 200 MB with up to 2,000,000 vertices, and a KMZ can hold up to 5,000 files and 500 MB unpacked. An export that would hold more than about 250 million characters of GPX or CSV text, or a shapefile table of more than about 500 MB or more than 255 columns, is refused with a message. A KML or GPX file in which any position has a longitude beyond 180 or a latitude beyond 90 is refused as a whole, with the message for damaged XML.
The viewer opens KML, KMZ, GPX and GeoJSON. It does not open shapefiles, CSV files or other formats, does not edit placemarks or draw new ones, does not play tours or a track's times as an animation, and does not save the files packed inside a KMZ.
Not tested yet: phones, the printed page itself (the tests check the list that is printed, not the print dialog), and the exported files in Google Earth or a desktop GIS program.
How to check that your file stays on your device
You do not have to take this on trust. Three checks, from quickest to most thorough:
- Go offline. Load the viewer, turn off Wi-Fi, then open a KML file with the Outline map on. It opens, which it could not do if the file had to reach a server.
- Watch the network. Open your browser's developer tools, go to the Network tab and open a file. The page fetches its own code and map data from kmlviewer.app and, if analytics is on, loads Google Analytics' script and sends it small requests. None contains your file, its name or anything in it. Choose a remote base map and image requests to that one server appear, each a tile address with no part of your file in it.
- Read the security policy. Every page is sent with a Content-Security-Policy header. It lets the page send data only to kmlviewer.app and Google Analytics, and load pictures only from kmlviewer.app, from the page itself, from Google Analytics and from the three map servers.
Before each release, a test opens a file with a marker in its file name, a placemark name, a description, a data field and a folder name, and types another marker into the search box, while Google Analytics runs, and fails if a marker appears in any request. Another test chooses each remote base map in turn and checks that no tile is requested before the choice, that every tile address matches that server's address pattern with no query string, that each request carries only the site's origin as referrer, and that a reload with a remembered map requests no tiles.
There is no session recording on this site, because a recorder reads the page, and the page shows the names in your file and the addresses of the map tiles you look at. The privacy page lists what Google Analytics receives.