Geographic JavaScript Object Notation (.geojson)
IETF StandardGeographic JavaScript Object Notation (GeoJSON) is the universal, web-native standard for encoding geographic data structures, widely used in modern web mapping (Leaflet, Mapbox, OpenLayers) and GIS applications.
Convert GEOJSON to KML
Free in-browser GEOJSON to KML converter. Convert files instantly on your device.
Inspect & Metadata
Operating systems and file analyzers identify GeoJSON files by inspecting the leading binary byte sequence:
Byte-Level Header Signature (Magic Bytes)
Operating systems and file analyzers identify GeoJSON files by inspecting the leading binary byte sequence:
HEX SIGNATURE (OFFSET 0):
7B 0A 20 20 22 74 79 70 65 22 3A 20 22 46 65 61 74 75 72 65ASCII REPRESENTATION: {\n "type": "Feature
Standardization: IETF RFC 7946
Technical Specifications
| Container Architecture | JSON document adhering to RFC 7946 representing geographic Features, FeatureCollections, and Geometries |
| Compression | Uncompressed text (readily compressed over HTTP via Gzip or Brotli) |
| Byte Endianness | UTF-8 text stream |
| Color Spaces | N/A (Geographic Data) |
| Channels & Structure | Points, MultiPoints, LineStrings, MultiLineStrings, Polygons, MultiPolygons, GeometryCollections, and custom properties |
| Max Dimensions | World Geodetic System 1984 (WGS 84) coordinate space: Longitude (-180 to +180), Latitude (-90 to +90) |
| Transparency | None |
| Streaming & Progressive | Line-delimited GeoJSON (GeoJSONL / GeoJSONSeq) enables continuous streaming of millions of features |
Technical Comparison Matrix: GeoJSON vs Competitors
| Technical Attribute | GeoJSON (Current) | KML | GPX | SHP |
|---|---|---|---|---|
| Web Mapping Adoption | 100% universal web GIS default | Google Earth default | GPS device & fitness default | Desktop GIS legacy standard |
| Coordinate Order | [Longitude, Latitude] (X, Y) | Longitude, Latitude, Altitude | Latitude, Longitude | X, Y coordinates |
| Syntax Style | Clean JSON key-values | Verbose XML tags (<kml>) | Verbose XML tags (<gpx>) | Multi-file binary (.shp, .shx, .dbf) |
| Properties Schema | Arbitrary JSON properties object | ExtendedData schema tags | Fixed GPX schema tags | dBase IV (.dbf) fixed columns |
Common Corruption Modes & Hex Recovery Guide
Map points appear in the ocean near Antarctica instead of their true location.
Root Cause: Latitude and Longitude values were accidentally swapped in the coordinates array.
Recovery: Swap coordinate positions [lon, lat] using File2File GeoJSON Converter.
Security Analysis & Parser Attack Vectors
GeoJSON properties can contain arbitrary user inputs that must be sanitized before rendering into map popups to prevent XSS.
Known Attack Vectors
- Cross-site scripting (XSS) via unescaped HTML in GeoJSON feature properties rendered in map tooltips.
- Denial of service through deeply nested GeometryCollections or million-vertex polygons.
- Server-Side Request Forgery via remote GeoJSON feature loading.
Defensive Best Practices: Sanitize all property text strings with DOMPurify before inserting into map popup windows.
Historical Origins & Milestones
Key Advantages & Pros
- Native web standard: maps directly into JavaScript objects in browser mapping libraries (Mapbox GL JS, Leaflet).
- Human-readable JSON structure allows effortless programmatic creation, filtering, and debugging.
- Arbitrary property schema: attach any custom metadata (population, name, speed, revenue) directly to geometric shapes.
Technical Limitations & Cons
- Text verbosity: stores floating-point coordinates as repeated ASCII digits, leading to larger file sizes than binary Shapefiles or FlatGeobuf.
- RFC 7946 strictly mandates [Longitude, Latitude] order, which frequently confuses developers accustomed to 'Lat/Long'.
- Large polygons with millions of vertices can cause web browser DOM rendering slowdowns.
Interesting Technical Trivia
- The official GeoJSON standard orders coordinates as [Longitude, Latitude] (X, Y Cartesian order), which is the exact opposite of how people speak ('Latitude, Longitude').
- If you commit a .geojson file to GitHub, GitHub automatically renders it as an interactive, clickable map.
- RFC 7946 mandates that polygon boundary rings must follow the 'right-hand rule': exterior rings must be wound counter-clockwise.
Frequently Asked Technical Questions
Why are my GeoJSON coordinates ordered [longitude, latitude] instead of [latitude, longitude]?
Because in mathematics and computer graphics, coordinates are always specified as (X, Y). Longitude represents the horizontal X-axis, and Latitude represents the vertical Y-axis.
How can I convert KML or Shapefile to GeoJSON?
You can convert Google Earth KML files or Esri Shapefiles into clean, web-ready GeoJSON in seconds using File2File.app directly in your browser.
What is the difference between GeoJSON and Shapefile?
Shapefile is an obsolete multi-file binary format from the 1990s (.shp, .shx, .dbf). GeoJSON is a modern, single-file open web format written in clean JSON.
Related GeoJSON Conversion Pairs
Convert GeoJSON vector features and properties into OGC KML format for Google Earth 3D mapping.
Convert Google Earth KML placemarks and polygon overlays into standard web-friendly GeoJSON.
Convert GeoJSON LineString geometry and track coordinates into standard GPS Exchange (GPX) routes.