Shorten Plus Code
Near the reference point 47.5, 8.5, the full Plus Code 8FVC9G8F+6X shortens to 9G8F+6X: the first four characters go, because the nearby area already supplies them. Only as many as can be safely recovered are removed. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Code
- 8FVC9G8F+6X
- Latitude
- 47.5
- Longitude
- 8.5
- Short code
- 9G8F+6X
- Full code
- 8FVC9G8F+6X
- Characters removed
- 4
- Code length
- 10
Open Location Codes, better known as Plus Codes, turn latitude and longitude into short strings that people can speak, type, and print without street numbers. A full code such as eight F V C nine G eight F plus six X is globally unique, but most everyday sharing happens inside a known city or neighbourhood, where the leading pairs repeat and only the trailing block identifies the spot. This Plus Code shortener accepts a valid full code plus a nearby reference latitude and longitude, measures how close the reference is to the code centre, and drops as many leading character pairs as the Open Location Code safety rule allows.
How Plus Code shortening works relative to a reference location
A full Open Location Code encodes a rectangular cell on the Earth using the twenty-character alphabet two through nine and C F G H J M P Q R V W X, with a mandatory plus separator after eight characters. The first ten significant digits form latitude and longitude pairs that refine the cell by successive factors of twenty; optional grid digits after the separator refine further.
When you share a location inside a known area, the first four or six characters often match every nearby place, so they add noise rather than value.
Shortening does not simply strip a fixed prefix: it decodes the full code to its cell centre, compares that centre to your reference latitude and longitude with a Chebyshev metric (the maximum of absolute latitude difference and absolute longitude difference in degrees), and walks a fixed resolution table of twenty, one, zero point zero five, zero point zero zero two five, and zero point zero zero zero one two five degrees.
Whenever the range is less than thirty percent of a given pair resolution, the algorithm may drop the corresponding leading pairs. That thirty percent factor is a deliberate safety margin so the short code remains the nearest match when someone later recovers it from a slightly different city centre or GPS reading. If the reference is far away, no pairs are removed and the full code is returned unchanged.
Padded codes that only describe a large area (with zeros before the separator) cannot be shortened, because they lack enough precision digits to trim safely. The capability implements this pure arithmetic path only: it does not look up place names, call maps APIs, or invent locality labels you should append yourself.
Where a Plus Code shortener earns its keep
Delivery, field-service, and logistics apps already store full Open Location Codes for doors that lack street numbers; when they print a label or send an SMS inside a known city they need the short form that drivers already recognise from Google Maps and plus.codes. Disaster-response and humanitarian mapping workflows share temporary shelters and water points as short codes plus a camp or district name, and a deterministic shortener guarantees every client—mobile offline pack, edge worker, or spreadsheet import—agrees on the same trim for the same reference.
Developers integrating OLC into forms can validate and shorten in one call without shipping a full open-location-code library to every client. Failed validation does not consume balance.
What you can do with it
SMS and label sharing in a known city
Turn a stored full Plus Code into a short code next to a city or neighbourhood name so drivers and customers see the compact form they already use in maps apps.
Offline and humanitarian mapping packs
Generate the same short codes offline for shelters and supply points given a camp reference lat/lon, so every device recovers the same nearest full code later.
FAQ
How do I shorten a Plus Code with a reference location?
Send a full Open Location Code in code plus finite reference latitude and longitude.
Can I shorten a short code or a padded area code?
No. Input must be a valid full code without padding zeros.
How close does the reference point need to be?
Close to the centre of the code's cell. Leading pairs are dropped only while the gap, measured as the larger of the latitude and longitude differences, stays under thirty percent of that pair's cell size, a safety margin for later recovery.
Why did my Plus Code come back unshortened?
Because the reference point is too far from the code's location to drop anything safely. In that case the full code is returned unchanged, and the result tells you that no characters were removed.
Should I add a place name to the short code?
Yes. A short code only works next to the town or neighbourhood it was shortened for, so share it with that place name. The tool does not look up or invent place names; you add the locality yourself.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/plus-code-shorten \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"code":"8FVC9G8F+6X","latitude":47.5,"longitude":8.5}'const res = await fetch("https://api.kit.forhosting.com/geo/plus-code-shorten", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"code": "8FVC9G8F+6X",
"latitude": 47.5,
"longitude": 8.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/plus-code-shorten",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"code": "8FVC9G8F+6X",
"latitude": 47.5,
"longitude": 8.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/plus-code-shorten", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"code":"8FVC9G8F+6X","latitude":47.5,"longitude":8.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"code":"8FVC9G8F+6X","latitude":47.5,"longitude":8.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/plus-code-shorten", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"code": "8FVC9G8F+6X",
"latitude": 47.5,
"longitude": 8.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.plus_code_shorten",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The result is a compact short code ready to pair with a place name, while the API also returns whether shortening occurred, how many characters were removed, and the angular range used. Invalid full codes, padded area codes, and missing coordinates fail with clear invalid_input errors instead of inventing an ambiguous fragment.
Input contract, response shape, and error behaviour
Padded codes that contain zero padding before the separator are rejected with a message that padded codes cannot be shortened. Latitude is clipped to the closed interval from negative ninety to ninety; longitude is normalised into the half-open interval from negative one hundred eighty to one hundred eighty. Missing fields, empty strings, and non-finite numbers fail with messages that name the field and are not billed. Example: code eight F V C nine G eight F plus six X with reference latitude forty-seven point five and longitude eight point five yields short code nine G eight F plus six X after dropping the first four characters. POST a JSON body with three required fields: code, a string full Open Location Code such as eight F V C nine G eight F plus six X; latitude, a finite reference latitude in signed decimal degrees; and longitude, a finite reference longitude in signed decimal degrees. Aliases are accepted for convenience: plus_code, olc, full_code, or location_code for the code; lat, ref_latitude, or reference_latitude for latitude; lon, lng, ref_longitude, or reference_longitude for longitude. The code is trimmed and uppercased; short codes (separator before position eight) and strings that fail the Open Location Code validity rules are rejected with invalid_input naming the field. On success the body echoes the normalised full code and cleaned coordinates, short_code (which may equal the full code when no safe trim is possible), was_shortened as a boolean, characters_removed as a non-negative integer, code_length as the significant digit count of the input, short_length as the significant digit count of the short form, range_degrees as the Chebyshev range rounded for stable goldens, and method set to olc_shorten. Pair the short code with a human locality string in your own UI; this endpoint never emits city names.
Where a Plus Code shortener earns its keep
Keep requests small, pin short_code and characters_removed in tests, and you get reproducible short Plus Codes for labels, chat bots, and edge workers without standing up geocoding infrastructure of your own.
Integration use cases
Field service and last-mile delivery
Shorten door-level OLC codes relative to a depot or zone centroid before printing work orders, without calling an external maps API.
Technical questions
What if the reference is far from the code?
No leading pairs are removed. short_code equals the full code, was_shortened is false, and characters_removed is zero so you never ship an ambiguous fragment.
Does the API add a city name after the short code?
No. It only trims leading OLC characters. Append your own locality label (city, district, or camp name) when displaying or messaging the short code.
What does the Plus Code shortener cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.