Google URL Shortening Service Format

Perm url with updates: http://xahlee.org/js/Google_url_shortening.html

Google URL Shortening Service URL Format

Xah Lee, 2011-02-02

Google has a url shortening service, at http://goo.gl/.

Here's some example of url it generates:

• goo.gl/3PrCo ⇒ xahlee.org/comp/FSF_free_beer_free_speech.html
• goo.gl/EH5fn ⇒ xahlee.org/kbd/dvorak_and_all_keyboard_layouts.html
• goo.gl/jzgjD ⇒ xahlee.org/comp/netscape_dot_com_nostalgia.html
• goo.gl/vfsem ⇒ xahlee.org/Periodic_dosage_dir/t2/cherry.html
• goo.gl/uc19a ⇒ xahlee.org/UnixResource_dir/writ/larry_wall_n_cults.html
• goo.gl/WBdW7 ⇒ xahlee.org/js/html5_video_audio.html
• goo.gl/bW0LZ ⇒ xahlee.org/emacs/elisp_all_about_lines.html
• goo.gl/ZPmVY ⇒ xahlee.org/Periodic_dosage_dir/lacru/odalisque.html
• goo.gl/1Zb9s ⇒ xahlee.org/Periodic_dosage_dir/sanga_pemci/hollaback_girl.html
• goo.gl/RvN1E ⇒ xahlee.org/perl-python/system_calls.html
• goo.gl/uXyas ⇒ xahlee.org/comp/netscape_dot_com_nostalgia.html
• goo.gl/Aq3BR ⇒ xahlee.blogspot.com/2011/02/sous-vide-heavy-metal-boredom-habits.html
• goo.gl/VS4X1 ⇒ xahlee.blogspot.com/2011/02/pirated-oreilly-books.html
• goo.gl/FoWLz ⇒ www.reddit.com/r/emacs/comments/fbg4l/ask_remacs_help_me_get_started_with_some_real/
• goo.gl/CfWhQ ⇒ www.reddit.com/r/emacs/comments/fbg4l/ask_remacs_help_me_get_started_with_some_real/

Notice that the format is goo.gl/xxxxx, and the xxxxx is 5 chars. Also, notice that each time you submit, it gives a new short url (if you are logged in). This means multiple short urls maps to the same original url.

There's something i don't understand about it.

The possible chars seem to be digits and english letters, both lower case and upper case. So, that's a total of 10+26+26=62 chars per slot. With 5 slots, the total space is 26^5 = 916.132832 * 10^6. Consider the number of urls that exist, and consider that one url can generate multiple short urls, this does not seem enough.

Also, i think i read somewhere from Google, that the new url is supposedly to be permanent. That is, years later they would return the same original url (assuming Google still lives). So, this means, i can't see how they can maintain this 5 char scheme. Perhaps in the future they might change the 5-slots scheme with more slots or chars.

For each url that exists, perhaps 1 in 1M are actually using url shortening service. So maybe the 5-slots 62 chars scheme would work fine for the foreseeable future.

See also: URL Shortening is BAD.