Open Location Code
The Open Location Code (OLC), also known as Plus Codes, is an open-source geocode system developed by Google that encodes latitude and longitude coordinates into short, human-readable alphanumeric strings representing specific geographic areas on Earth.[1] These codes serve as digital addresses, particularly useful in regions lacking formal street numbering or postal systems, and can be generated or decoded offline without relying on online services.[2] Developed at Google's Zürich engineering office and publicly released on April 30, 2015, the OLC addresses challenges in global navigation and logistics by providing a standardized, language-agnostic alternative to cumbersome coordinate pairs.[2] The system draws from existing latitude and longitude data, transforming it into compact codes that are case-insensitive and designed to minimize errors, using a 20-character alphabet consisting of the digits 2 through 9 and the letters C, F, G, H, J, M, P, Q, R, V, W, X.[1] For example, the full code 6GCRPR6C+24 identifies a 14-by-14-meter area near the Parliament Buildings in Nairobi, Kenya.[1] OLC codes structure alternates pairs of characters for latitude and longitude, starting from the equator and prime meridian, with precision increasing as more characters are added—eight characters cover roughly 100 by 100 meters, while ten or eleven provide finer resolution down to 14 by 14 meters.[1] A "+" symbol follows the eighth character to enhance readability and separate the global portion from local refinements. Codes can be shortened by omitting the first four to eight characters when a nearby reference location (such as a city or known landmark) is specified, reducing length for practical use, as in PR6C+24 Nairobi for the same Nairobi example.[1] This flexibility supports diverse applications, including delivery routing, emergency response, and community mapping of resources like water points in remote or urban informal settlements.[2] Integrated into Google Maps since its inception, OLC enables users to share locations easily via text or voice, and its open-source libraries are implemented in multiple programming languages for broad accessibility.[3] The technology promotes inclusivity by working across over 30 languages and in low-connectivity environments, though it represents areas rather than precise points to account for real-world navigation needs.[2]History and Development
Origins
Development of the Open Location Code (OLC) began at Google's Zürich engineering office, where engineers sought to create a standardized system for identifying locations without relying on traditional street addresses.[2] The primary motivations for this initiative were to facilitate digital access and services in underserved areas, including slums, rural regions, and informal settlements, by converting readily available latitude and longitude coordinates into human-readable, shareable codes that could function like addresses.[1] This approach aimed to bridge gaps in global addressing infrastructure, particularly in developing regions where formal addresses are scarce or unreliable, thereby supporting applications like emergency response, logistics, and mapping without requiring new infrastructure.[1] Key initial design decisions focused on practicality and usability: a hierarchical grid structure was adopted to enable variable precision, allowing codes to scale from broad areas (e.g., cities) to precise spots (e.g., building entrances) by adjusting code length.[1] To ensure readability and minimize transcription errors, the system uses a 20-character alphabet excluding ambiguous letters and numbers such as I, L, O, and 0, while alternating pairs of characters to encode latitude and longitude sequentially.[1]Release and Adoption
The Open Location Code system was publicly announced on April 30, 2015, through a post on Google's Open Source Blog, introducing it as an open standard for generating short, shareable location codes derived from latitude and longitude coordinates.[2] The initial implementation was released under the Apache License 2.0, enabling free use, modification, and distribution by developers worldwide. Shortly after the announcement, the project was open-sourced on GitHub under the repository google/open-location-code, which includes reference implementations and libraries supporting multiple programming languages such as Java, JavaScript, Python, C++, Go, and .NET, along with community-contributed ports to languages like Swift and Rust.[1] These libraries facilitate integration into applications for encoding and decoding codes offline, promoting widespread developer adoption. Early adoption began with integration into Google Maps in August 2015, where Plus Codes— the branded name for Open Location Codes—became searchable and shareable directly within the platform, allowing users to pinpoint locations without traditional addresses.[4] Partnerships with humanitarian organizations further accelerated use; for instance, the postal service in Cape Verde became one of the first to support Plus Codes for mail delivery to areas with unnamed streets, while the International Rescue Committee in Somalia utilized them to map client locations for family planning and immunization programs, improving access to health services in underserved regions.[5][6] By 2020, Plus Codes were available globally through Google Maps and related services, supporting applications in logistics, emergency response, and urban planning where formal addressing is limited.[7] As of 2023, updates to the core libraries enhanced code validation mechanisms and introduced improved error correction capabilities, such as better handling of typographical errors in short codes, including input validation additions in the JavaScript implementation; to increase reliability in real-world deployments.[1]System Overview
Purpose and Principles
The Open Location Code (OLC) system serves as a geocoding method to generate short, alphanumeric codes known as "plus codes," functioning as digital addresses for precise locations worldwide, especially in regions lacking reliable street addressing systems. These codes enable users to identify and share specific places without depending on formal address infrastructure, supporting applications like navigation, emergency services, and logistics in underserved areas. Developed to address the global challenge of incomplete addressing, OLC transforms latitude and longitude coordinates into a compact, usable format that promotes equitable access to location-based services.[1][2] At its core, OLC is built on principles of universality and simplicity, ensuring full global coverage through alignment with the WGS84 geographic coordinate datum, which standardizes positions across the planet without regional biases. The design incorporates a hierarchical grid structure that scales precision progressively—from large areas like 1° by 1° at the coarsest level to finer resolutions as additional code characters are included—allowing flexibility for various use cases while maintaining consistency. Codes are rendered in a human-readable alphanumeric format using a 20-character set (omitting I, O, and Z to avoid confusion with digits), mimicking familiar postal or zip codes to enhance memorability and ease of verbal or written transmission. This approach prioritizes practicality over exact point precision, representing small rectangular areas rather than single points.[1] Accessibility is a foundational principle, with OLC being entirely free, open-source, and implementable offline, free from dependencies on proprietary mapping services or real-time data connections. The system's algorithms are publicly available in multiple programming languages, enabling broad adoption by developers, governments, and organizations without licensing restrictions. Furthermore, OLC includes basic validation for code structure and character usage to detect obvious input errors.[1] In contrast to traditional latitude and longitude coordinates in decimal degrees, which often require cumbersome notation (e.g., multiple decimal places) and can be prone to miscommunication, OLC codes are significantly shorter and more intuitive, typically 8–11 characters for practical resolutions, making them easier to dictate over phone, write on forms, or input manually. This design philosophy underscores OLC's goal of democratizing location sharing, particularly for non-technical users in diverse global contexts.[1][2]Key Components
The Open Location Code system employs a specific character set consisting of 20 alphanumeric characters: the digits 2 through 9 and the uppercase letters C, F, G, H, J, M, P, Q, R, V, W, and X. This selection deliberately excludes characters that could cause confusion, such as 0 and 1 (which resemble O and I), as well as vowels to minimize the formation of unintended words across multiple languages.[8][1] Codes in the system vary in length to achieve different levels of spatial precision, defining rectangular areas on Earth's surface. With 4 characters, a code covers a 1° × 1° area, approximately 110 km × 110 km (about 12,000 km² at the equator), suitable for broad regional identification; this refines progressively, reaching sub-centimeter resolutions (e.g., about 1 cm × 0.5 cm at 15 characters) for high-precision applications. Standard full codes typically use 10 or 11 characters, providing a resolution of roughly 14 m × 14 m, which is adequate for pinpointing buildings or small plots without excessive length.[1][8] The code format interleaves pairs of characters representing latitude and longitude coordinates in an alternating manner, with the sequence always beginning with the latitude component. This hierarchical structure encodes positions relative to a global grid, where each subsequent pair subdivides the previous area. A "+" separator is inserted after the eighth character in full codes longer than 8 characters to improve readability, resulting in formats like "XXXXXX XX+XX".[1][2] Validation features include checks for valid character usage and proper structure. Codes are case-insensitive, designed to facilitate easy manual entry on devices like mobile phones.[1]Technical Specification
Grid System
The Open Location Code (OLC) grid system provides a hierarchical spatial framework for encoding locations on Earth's surface using latitude and longitude coordinates in the WGS84 datum. At the highest level, the globe is partitioned into 20° × 20° blocks spanning latitudes from -90° to 90° and longitudes from -180° to 180°, resulting in 9 rows (covering 180° latitude) and 18 columns (covering 360° longitude).[1] This top-level grid is recursively subdivided into 20 × 20 sub-grids at each subsequent level, exponentially reducing the area of each cell by a factor of 400 per pair of characters added to the code. For instance, the first subdivision level yields 1° × 1° blocks, while the fourth level produces cells of approximately 0.000125° × 0.000125° (about 14 m × 14 m at the equator). Grid positions within these cells are represented using a base-20 encoding scheme.[1] The achievable precision depends on the number of code characters, with cell sizes decreasing as more subdivisions are applied. Approximate side lengths at the equator are summarized in the following table:| Code Characters | Approximate Side Length |
|---|---|
| 2 | 2,200 km |
| 4 | 110 km |
| 6 | 5.5 km |
| 8 | 280 m |
| 10 | 14 m |
| 11 | 3.5 m (one axis) |
Encoding and Decoding
The encoding process for Open Location Codes converts geographic coordinates (latitude and longitude) into a compact alphanumeric string using a hierarchical grid system based on base-20 arithmetic. Latitude and longitude are first normalized by adding 90° to latitude and 180° to longitude (offsetting from the South Pole and antimeridian), then scaled to [0, 20^n) where n is the number of digits per coordinate (typically 5 for standard 10-character codes, up to 8 for maximum precision). For latitude, scale by 20^n / 180; for longitude, 20^n / 360. This maps the global extent into a uniform numerical range suitable for base-20 digitization. The character set is 23456789CFGHJMPQRVWX.[1] The normalized values are then converted to base-20 digits, with latitude and longitude digits interleaved alternately, starting with latitude, to form pairs representing successively finer grid subdivisions. Codes consist of an even number of characters (2 to 10 for standard precisions), with the "+" inserted after the 8th character. For lengths beyond 10 characters (up to 15), the area is divided into a 4×5 grid (latitude × longitude) per additional character to maintain base-20 encoding. For a 10-character code (5 pairs), this corresponds to approximately 14 × 14 meter areas.[1] Decoding reverses this process to recover the bounding box of the location from a valid code string. The code is validated for format, valid characters, and proper "+" position. The digits before and after "+" are de-interleaved into separate base-20 sequences for latitude and longitude based on the code length. Each sequence is converted to a decimal by summing digit_i × 20^{m-1-i} where m is the number of digits for that coordinate. These decimals are then scaled back: latitude = (lat_decimal / 20^m × 180) - 90, longitude = (lon_decimal / 20^m × 360) - 180, where m is the number of digits (e.g., 5 for standard). The resulting values define the southwest corner of the grid cell; the full bounding box is obtained by adding the grid size at that precision (e.g., 180° / 20^5 for latitude in a 10-character code). The process operates offline and handles the global grid without special cases for poles or date lines due to the normalization.[1] Error handling relies on format validation to detect invalid inputs. While the system does not include built-in error correction, the dense encoding allows potential recovery by testing nearby codes if needed, though this is not part of core implementations.[1]Code Usage
Full Codes
Full codes in the Open Location Code system are self-contained, globally unique identifiers that specify a location on Earth without needing a reference point. They consist of 10 alphanumeric characters structured as 8 characters encoding the primary grid position, followed by a "+" separator and 2 additional characters for increased precision.[9][1] This format uses a restricted set of 20 characters (2-9, C, F, G, H, J, M, P, Q, R, V, W, X) to avoid visual confusion and ensure readability.[9] These codes are generated directly from latitude and longitude coordinates via an encoding algorithm that hierarchically subdivides the globe into grids, starting from 20° × 20° areas and refining down to smaller cells.[1] The standard 10-character full code achieves a resolution of approximately 14 m × 14 m, sufficient for pinpointing features like building entrances or small plots.[1] For finer granularity, an 11th character can be appended after the "+", narrowing the area to roughly 3.75 m × 3 m.[9] In usage, full codes are input directly into compatible applications, such as Google Maps, where they decode to the exact 14 m × 14 m bounding box without further context.[9] They support offline processing through open-source libraries, enabling decoding on devices without network access.[1] Full codes offer distinct advantages in their standalone nature, eliminating any risk of ambiguity from local references and facilitating easy sharing for precise navigation.[1] Their global uniqueness and offline compatibility make them particularly valuable for scenarios requiring reliable, verifiable location data.[9]Shortened Codes
Shortened codes, also known as short plus codes, provide a compact representation of locations by abbreviating full Open Location Codes relative to a known reference point, such as a city center. The shortening process involves removing a prefix of 4, 6, or 8 characters from the beginning of a full code, corresponding to the shared grid levels between the target location and the reference point. This prefix represents coarser geographic divisions that are identical for locations within the same hierarchical grid cells. The resulting short code is then appended with the name of the reference location, for example, transforming a full code into "7VP3+PR Singapore" when using Singapore as the reference.[8][10] To expand a shortened code back to its full form, the reference location's latitude and longitude coordinates are used to determine and prepend the missing prefix characters. This recovery process identifies the nearest valid full code that matches the provided short suffix, ensuring the expanded code aligns with the original location within the grid system. Short codes must consist of at least 4 alphanumeric characters (excluding the '+' and reference location name), and the reference location must lie within the same 20x20° global grid block as the target to avoid ambiguity in prefix reconstruction.[8][1] Limitations on shortening include the inability to reduce a code below 4 alphanumeric characters in total length, as further truncation would compromise recoverability. Shortening is invalid if the reference location is too distant—specifically, beyond 50% of the maximum allowable range for the given truncation level—or if it crosses grid boundaries, such as differing 20x20° blocks, which would mismatch the initial code characters. These constraints ensure unambiguous expansion even with minor inaccuracies in the reference coordinates.[8][10] Implementation of shortened codes is supported through open-source libraries available in multiple programming languages, such as JavaScript, Go, and Python, which automate the shortening and expansion processes using the reference location. Additionally, the Google Maps Platform Geocoding API handles plus codes, including shortened variants, in requests and responses, enabling seamless integration for mapping and navigation applications.[1][11]Examples
Basic Encoding Example
To illustrate the encoding process for a full Open Location Code, consider the location of Merlion Park in Singapore at approximately 1.2868° N latitude and 103.8545° E longitude. This site features the iconic Merlion statue and serves as a useful real-world example for demonstrating how geographic coordinates are transformed into a compact code. The encoding begins by normalizing the latitude and longitude to fit within a numerical range suitable for base-20 representation. Specifically, the latitude index is calculated as floor(((latitude + 90) / 180) * 20^4), and the longitude index as floor(((longitude + 180) / 360) * 20^4), producing integers from 0 to 20^4 - 1 = 159999. These integers are converted to base-20 using the alphabet "23456789CFGHJMPQRVWX", where each digit represents a subdivision of the grid.[1] The base-20 digits from latitude and longitude are interleaved, starting with a latitude digit, to form the core 8-character code. For the Merlion Park coordinates, this interleaving yields "6PH57VP3". A "+" separator is inserted after the 8th character for readability, and a 2-digit checksum is computed using a weighted sum of the code's characters modulo 20, then appended in base-20 to verify integrity. The checksum for this code is "PR", resulting in the full Open Location Code6PH57VP3+PR.[1]
This full code identifies a small rectangular area of approximately 14 m × 14 m centered around the input coordinates (with slight variations due to latitude affecting the longitude grid size). To verify, decoding 6PH57VP3+PR reverses the process: the digits are de-interleaved, converted from base-20, scaled back, and offset to yield coordinates of 1.2868° N, 103.8545° E, which aligns closely with the Merlion Park location and confirms the encoding's accuracy.[1]
Shortening Example
To illustrate the shortening of an Open Location Code, consider the full code for Merlion Park in Singapore, which is6PH57VP3+PR. This code encodes a precise location area of approximately 14 meters by 14 meters.[1]
When sharing this code locally within Singapore, it can be shortened by using a nearby reference point, such as the coordinates of Singapore's city center (approximately 1.2897° N, 103.8501° E). The shortening process identifies the common prefix shared between the full code and the reference location, allowing the removal of the first four characters (6PH5), as they represent a coarse grid that encompasses both areas. The resulting shortened code is 7VP3+PR Singapore, which is paired with the locality name for context.[1]
To expand the shortened code back to its full form, the reference coordinates of Singapore city center are used to prepend the appropriate prefix (6PH5), recovering the original 6PH57VP3+PR. This expansion maintains the same precision level, with the location area remaining approximately 14 meters by 14 meters, ensuring no loss of accuracy for the target spot.[1]
In practice, shortened codes like this are typically 6 to 8 characters long (plus the locality), making them simpler and more memorable for local communication, such as directing someone to a nearby landmark without needing the full global identifier.[1]