A URL shortener is a service that takes a long web address and gives you a short one that points to it. Click the short link, and the service looks up which destination it stores against that key, then sends your browser there with an HTTP redirect, usually in a fraction of a second. Everything else people mean by "short URL" or "link shortener" is a variation on that one mechanism.
How does a URL shortener work
Strip away the branding and every shortener does the same three things: it generates a key, stores a mapping, and answers with a redirect.
- The key. The random-looking characters after the domain, like
bit.ly/3xK9pQorraydar.bio/r/4f2a, are not the destination. They're a key, nothing more. - The mapping. Somewhere in a database, that key points at a full destination URL, along with whatever metadata the service tracks alongside it.
- The redirect. When a browser requests the short link, the service doesn't fetch the destination page and hand you a copy of it. It sends back an HTTP response with a 3xx status code and a
Locationheader containing the real URL, and your browser reads that header and makes a second request to the actual destination. That's the brief pause before the page you actually wanted loads.
That's the whole mechanism. No magic, no compression of the URL itself. Just a lookup table and a redirect.
The key itself is usually a short random string, generated from a mix of letters and digits (base62, roughly 62 possible characters per position), so a handful of characters can represent millions of unique combinations without ever repeating. Some services assign keys sequentially instead, counting up one link at a time. Either way, most platforms also let you pick your own key: a custom alias like /summer-sale instead of /4f2a, stored in the exact same lookup table, resolved through the exact same redirect.
301 or 302: the redirect type decides what happens next
The status code in that response matters more than most explanations of shorteners let on, because it changes what browsers and search engines are allowed to assume.
| Redirect type | What it tells the browser | Cached long-term | Destination stays editable |
|---|---|---|---|
| 301 (permanent) | This move is final. Update your records. | Yes, browsers and crawlers may skip the short link entirely on future visits and go straight to the destination they cached | No, once it is cached widely, changing the mapping does not reliably reach everyone |
| 302 (temporary) | The content is here for now, but ask again next time. | No, or only briefly | Yes, the service can repoint the key to a different destination whenever it wants |
Link platforms almost always use 302-class redirects, and the reason is that last row in the table. A 301 hands control of the mapping to every browser and crawler that ever caches it, permanently. A 302 keeps the short link itself as the canonical entry point. That's what lets the destination change without the short link ever needing to be reissued: swap a campaign URL, fix a typo in the target, retire an old product page and point the same short link somewhere new. It's also why a short link can quietly live for years while still counting, technically, as temporary in the eyes of every browser that visits it.
If you're building a link tool from scratch, use 302. There's rarely a good reason to reach for 301 on a general-purpose shortener, since it trades away the one thing that makes the product useful in the first place: the ability to change your mind about where a link points.
Why the redirect is also where measurement happens
Every time a browser requests a short link, it passes through a server the shortener controls before it reaches the destination. That hop is free real estate. A timestamp, the requesting device, the referring page, the country the request came from, all of it is available to log at essentially zero extra cost, since the redirect was going to happen anyway. This is why shorteners and click analytics ended up as the same product instead of two separate ones, and it's the only point in the whole chain where the link owner, rather than the destination site, gets to see who actually showed up.
What a custom domain actually changes
A "branded link" or "custom domain" is the identical mechanism, just running on a domain you control instead of the shortener's own. yourbrand.co/summer and bit.ly/3xK9pQ do the same job: key, lookup, redirect. The only difference is whose name sits in the address bar. That's not nothing, though. It matters for trust (a link on a domain people already recognize gets clicked more readily than one on an unfamiliar shortener), and it matters for continuity, since a domain you control doesn't disappear if a third-party shortener shuts down or gets acquired. For anything you're putting in front of customers regularly, a branded domain is worth the setup time. For a one-off link in a group chat, it obviously isn't. Raydar's link wrapper works this way: the same redirect-and-log mechanism, on a domain you own if your plan supports one, with the click data landing in your own account rather than a shortener's dashboard.
Why URL shorteners exist
The original reason was character limits. Twitter's 140-character cap in the late 2000s turned a 90-character product URL into a real problem, and shorteners solved it by trading a long address for a short key. Print and SMS had the same constraint for even longer: nobody wants to read a tracking-parameter-laden URL off a billboard.
That problem has mostly gone away. Most platforms auto-shorten or hide long URLs in the display layer now, so the character-count issue that created the category barely applies anymore. What kept the category alive is measurement and branding, knowing who clicked and controlling what the link looks like, even though the mechanism underneath never changed.
The tradeoffs
A shortener isn't free, even when there's no price tag attached. The convenience comes with real costs, and it's worth being upfront about what they are.
- An extra hop. Every short link adds one more network round trip before the real page starts loading. On a fast connection you won't notice. On a slow mobile connection, stacked in front of a page that's already slow, it's a real, felt delay.
- Opacity of the destination. A shortened link hides where it goes until you click it. That's convenient for a clean-looking bio link and useful cover for a phishing link, and the mechanism itself doesn't care which one you're building. Check a short link before you click it: see is a URL shortener safe to click for how.
- Dependency on the service staying up. The short link only works as long as the lookup table behind it exists. If the shortener shuts down, gets acquired and sunset, or simply deletes old links to cut costs, every short URL built on it stops resolving. Several shorteners that were popular a decade ago have already done exactly that.
Of the three, the first two barely matter. A redirect hop costs milliseconds, and opacity is solved by hovering over a link before you click it. The third one is the one actually worth worrying about, because there's no workaround for a database that no longer exists.
Link rot: the risk most explanations skip
Link rot is what happens when a short link stops resolving: the shortening service shut down, purged inactive links, or simply lost the row in its database. Put a short link in a book, a printed flyer, an email signature, or an old blog post, and you're betting that one company keeps running that one lookup table indefinitely, for free or for the price of your subscription.
Long-form URLs rot too. Pages move, sites restructure, links break, but that's a problem the destination owner can usually fix with their own redirect. A dead shortener is different: nobody can fix it, because the mapping lived in a database nobody but the vendor ever had access to. If you're putting a short link somewhere permanent (a business card, a printed sign, a contract), that risk is worth weighing against the convenience of a shorter address. The safer version of that trade is a shortener running on a domain you own, so if you ever switch providers, the domain and its history move with you instead of dying with the vendor.
Short URL, link shortener, URL shortener: same thing
These three terms describe the identical mechanism from different angles. "URL shortener" and "link shortener" both name the service. A "short URL" or "short link" is the specific output that service produces: the key plus the domain, sitting in front of a stored mapping and a redirect. If a page or a person uses one term and not the others, they're talking about the same key-lookup-redirect chain described above.
A short link is nothing more than a redirect wired to a database row. That explains why the destination can change, why analytics live in the same product, and why some links eventually stop working. It's also worth knowing what happens on the other side of that redirect before a visitor even sees a page: see how link preview pages work for what platforms generate from a link before anyone clicks it.