What Is a URL Shortener and How Does It Work?
By Urlzee Team · Published · 5 min read
A URL shortener is a service that gives you a short web address which forwards to a longer one. You paste a long URL, the service stores it and hands back a short link, and anyone who opens that short link is redirected to the original page, usually faster than they can notice.
What does a shortened URL look like?
A shortened URL has a short domain followed by a few characters that identify your link. Take a typical product page address:
https://example.com/shop/garden/outdoor-furniture/folding-chair-oak?colour=natural&utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale
After shortening, it might become:
https://urlzee.com/k3Xp9a
The part after the slash is often called the slug, code or alias. It can be random, like k3Xp9a, or something you choose, like spring-chair. Either way it is just a key. The long address has not been compressed into those six characters; it is sitting in a database, and the slug is how the service finds it again.
How does a URL shortener work, step by step?
A shortener does two jobs: it saves a mapping when you create a link, and it answers with a redirect when someone visits. Here is the whole round trip.
- You submit a long URL. The service checks that it is a valid address and, on reputable shorteners, that it does not point somewhere harmful.
- The service generates a slug. This is either a random string that is not already in use, or the custom alias you asked for.
- The pair is stored. The database now holds a row that says, in effect, "
k3Xp9ameanshttps://example.com/shop/...". - Someone opens the short link. Their browser sends an ordinary HTTP request to the shortener for the path
/k3Xp9a. - The server looks up the slug. If it finds a match, it replies with a redirect status code and a
Locationheader containing the long URL. - The browser follows the redirect. It immediately requests the long URL, and the destination page loads. The address bar now shows the destination, not the short link.
Steps 4 to 6 normally take a fraction of a second. The visitor sees one page load, not two.
If you are curious about the storage and ID-generation side, how URL shorteners work under the hood goes into the engineering.
Which redirect does a short link use?
Short links use an HTTP 3xx redirect, and the exact code depends on the service. The two you will meet most often are 301 and 302.
| Status code | Meaning | What it means for a short link |
|---|---|---|
| 301 Moved Permanently | The address has changed for good | Browsers may cache it, so later visits can skip the shortener entirely |
| 302 Found | A temporary redirect | The browser asks the shortener each time, so every click can be counted and the destination can be changed |
| 307 / 308 | Temporary / permanent, with the request method preserved | Less common for shorteners; behave like 302 / 301 for normal link clicks |
Urlzee uses 302. That keeps click counts accurate and means an edited destination takes effect straight away, because browsers do not hold on to an old answer. The trade-offs between the two are covered in 301 vs 302 redirects.
Why do people shorten URLs?
People shorten URLs for four practical reasons: space, readability, measurement and flexibility.
Space. A text message, a printed flyer and a social profile all have limited room. A 20-character link leaves more of it for your actual message.
Readability. A long address full of question marks and percent signs looks untidy and is impossible to read aloud. urlzee.com/menu can be said in a sentence and typed from memory.
Measurement. Because every visit passes through the shortener, the service can count it. With a free Urlzee account, link analytics show clicks by day, country, referrer, device, browser and operating system. Known bots are filtered out, and visitor IP addresses are not stored with clicks.
Flexibility. The short link and the destination are separate things, so the destination can be swapped later without reprinting or resharing the link. On Urlzee that is a Pro feature.
A short link also produces a simpler QR code. Fewer characters mean fewer squares in the pattern, which makes the code easier to scan at small sizes.
What are the downsides of a URL shortener?
The main downsides are that a short link hides its destination and depends on the shortening service staying online.
- Hidden destination. You cannot tell from
urlzee.com/k3Xp9awhere it leads. That is fine when you trust the sender, and a problem when you do not. If you are unsure about a link you received, paste it into a URL expander to see the real destination first. There is more on this in are short links safe? - A dependency. If the shortener shuts down or disables the link, the short URL stops working even though the destination page is fine. Choose a service whose terms on expiry are clear.
- An extra hop. The redirect adds one more request before the page loads. It is small, but it is not zero, which is one reason not to use short links for navigation inside your own website.
- Filtering. Some email filters and platforms treat links from widely abused short domains with suspicion. Sending from a reputable service and avoiding spam-like behaviour matters more than the link format itself.
When should you not use a short link?
Skip the shortener when the original URL is already short and trustworthy, or when the reader benefits from seeing the full address. Links between pages of your own site should use the real URLs. So should links in legal or formal documents where a reader may want to verify the domain at a glance. And if a link only has to survive one private chat, shortening it adds nothing.
How do you create a short link?
Creating one takes a few seconds. On the Urlzee URL shortener, paste the long address, optionally type an alias of your own, and press Shorten. No account is needed. You get the short link and a QR code for it.
If you want to see clicks, sign up for a free account before you create the link so it appears in your dashboard. The free plan covers 50 links a month with 30 days of analytics.
That is all a URL shortener is: a lookup table with a redirect in front of it. The value comes from what that small indirection lets you do, which is share a tidy address, count who used it, and keep control of where it leads.
Frequently asked questions
- What does a URL shortener do?
- It creates a short web address that redirects to a longer one. When someone opens the short link, the shortener's server looks up the original address and sends the browser there.
- Are URL shorteners free?
- Many are. Urlzee shortens links for free without an account; paid plans on most services add things like higher limits, longer analytics history and editable destinations.
- Does a short link change the page it points to?
- No. The destination page is untouched. The short link is only a pointer, so the visitor ends up on exactly the same page, with the same address in the browser bar, as if they had used the long URL.
- Can anyone see where a short link goes before clicking?
- Yes. A URL expander follows the redirect on a server and shows you the final destination without loading the page in your own browser.