HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
google
open-location-code
Java2015–2024
google / open-location-code

open-location-code

Open Location Code is a library to generate short codes, called "plus codes", that can be used as digital addresses where street addresses don't exist.

55Distinct people
68Mentions
0Explicit recommenders
4.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Open Location Code is a library to generate short codes, called "plus codes", that can be used as digital addresses where street addresses don't exist.

GitHub

Where it is used

  • Google Maps — Google Maps uses Open Location Code by making its “plus codes” searchable within Google Maps. This enables users to look up locations using plus codes in the Maps product. Source
  • Geocoding API (Google Maps Platform) — Geocoding API returns a "plus_code" field using Open Location Code to represent encoded location references. The API exposes these plus codes as a replacement for street addresses in places without conventional addresses. Source

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 7:02:50 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year68 dated mentions

Observed mentions: 2015-02-11 23:04:48 UTC to 2024-08-23 21:44:04 UTC.

0510152015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 17 mentions; 4 submissions, 13 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 16 mentions; 3 submissions, 13 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 13 mentions; 3 submissions, 10 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC615
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC211
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC17413
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC16313
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC404
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC13310
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC220
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC514
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Open Location Code Open Location Code is a technology that gives a way of encoding location into a form that is easier to use than latitude and longitude. The codes generated are called Plus Codes, as their distinguishing attribute is that they include a "+" character. The technology is designed to produce codes that can be used as a replacement for street addresses, especially in places where buildings aren't numbered or streets aren't named. Plus Codes represent an area, not a point. As digits are added to a code, the area shrinks, so a long code is more precise than a short code. Codes that are similar are located closer together than codes that are different. A location can be converted into a code, and this (full) code can be converted back to a location completely offline, without any data tables to lookup or online services required. Codes can be shortened for easier communication, in which case they can be used regionally or in combination with a reference location that all users of this short code need to be aware of. If the reference location is given in form of a location name, use of a geocoding service might be necessary to recover the original location. Algorithms to encode and decode full codes, shorten them relative to a reference location, and recover a location from a short code and a reference location given as latitude/longitude pair are publicly available and can be used without restriction. Geocoding services are not a part of the Open Location Code technology. Links Demonstration site Mailing list Comparison of existing location encoding systems Open Location Code definition Description Codes are made up of a sequence of digits chosen from a set of 20. The digits in the code alternate between latitude and longitude. The first four digits describe a one degree latitude by one degree longitude area, aligned on degrees. Adding two further digits to the code, reduces the area to 1/20th of a degree by 1/20th of a degree within the previous area. And so on - each pair of digits reduces the area to 1/400th of the previous area. As an example, the Parliament Buildings in Nairobi, Kenya are located at 6GCRPR6C+24. 6GCR is the area from 2°S 36°E to 1°S 37°E. PR6C+24 is a 14 by 14 meter wide area within 6GCR. A "+" character is used after eight digits, to break the code up into two parts and to distinguish codes from postal codes. There will be locations where a 10-digit code is not sufficiently precise, but refining it by a factor of 20 is i) unnecessarily precise and ii) requires extending the code by two digits. Instead, after 10 digits, the area is divided into a 4x5 grid and a single digit used to identify the grid square. A single grid refinement step reduces the area to approximately 3.5x2.8 meters. Codes can be shortened relative to a location. This reduces the number of digits that must be remembered, by using a location to identify an approximate area, and then generating the nearest matching code. Shortening a code, if possible, will drop four or more digits from the start of the code. The degree to which a code can be shortened depends on the proximity of the reference location. If the reference location is derived from a town or city name, it is dependent on the accuracy of the geocoding service. Although one service may place "Zurich" close to the Google office, another may move it by a hundred meters or more, and this could be enough to prevent the original code being recovered. Rather than a large city size feature to generate the reference location, it is better to use smaller, neighbourhood features, that will not have as much variation in their geocode results. Guidelines for shortening codes are in the wiki. Recovering shortened codes works by providing the short code and a reference location. This does not need to be the same as the location used to shorten the code, but it does need to be nearby. Shortened codes always include the "+" character so it is simple to compute the missing component. 8F+GG is missing six leading characters 6C8F+GG is missing four leading characters Example Code The subdirectories contain sample implementations and tests for different languages. Each implementation provides the following functions: Test a code to see if it is a valid sequence Test a code to see if it is a valid full code (not all valid sequences are valid full codes) Encode a latitude and longitude to a standard accuracy (14 meter by 14 meter) code Encode a latitude and longitude to a code of any length Decode a code to its coordinates: low, high and center Shorten a full code relative to a location Extend a short code relative to a location
Read the full README on GitHub

What Hacker News says

4 sources
Huh, interesting. For stuff like this (human-friendly numbers/ids/codes) I tend to use google's base20 Open Location Code alphabet[0] that I read an explanation of a long time ago on their website[1] :P. Whereas this project aliases some similar letters together, the OLC alphabet avoids similar looking letters altogether and tries to avoid spelling any words at all. Keep in mind that "oh, letters are aliases for each other" doesn't necessarily help now that "passwords are case sensitive" is also drilled into users' heads, and no distinction between I/l is even more rare than case sensitivity, so users might unnecessarily remember the difference or make a fuss about it (speaking from experience working with my grandmother and technology). Anyway, usually I just copy/paste a piece of code like below to use the OLC alphabet and randomly gene
Read the rest
rate an id, and you could just copy the literal to use as a radix alphabet as well. "".join(random.choices("23456789CFGHJMPQRVWX", k=5)) # check against id in dict if userinput.toupper() in idmapping: ... [0]: https://github.com/google/open-location-code/blob/master/js/... [1]: https://github.com/google/open-location-code/blob/master/doc..., under "Easy to use"
In Show HN: Base32H, a human-friendly duotrigesimal number system
Another interesting solution to this problem is that used by plus codes [1]: > The characters that are used in Open Location Codes were chosen by computing all possible 20 character combinations from 0-9A-Z and scoring them on how well they spell 10,000 words from over 30 languages. This was to avoid, as far as possible, Open Location Codes being generated that included recognisable words. The selected 20 character set is made up of "23456789CFGHJMPQRVWX". [2] [1]: https://plus.codes [2]: https://github.com/google/open-location-code/blob/master/doc...
In Show HN: Base24 binary-to-text encoding for humans

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.