basics · how-to

How to Shorten a URL: Every Method, From Click to API

Every way to shorten a link: instantly with no account, with a custom alias, on your own domain, with a password or expiry, or in bulk with the API.

7 min read1,487 wordsUpdated
Guide cover: how to shorten a URL — every method, one click to API

Shortening a URL takes one click, and for a link you'll share once that's all it needs. The interesting question is what you want the link to do afterwards — carry your name, be readable aloud, stop working after Friday, count its clicks — because each of those is a different way of shortening, and picking the right one up front saves reprinting, reposting and re-explaining. This guide covers every method from the quick one to the automated one, when each is the right choice, and what to do with the link once you have it.

Four ways to shorten a URL, from one click to automation: paste, name it, your domain, API; an expiry can be added to any of them, and a password to any made while signed in
Four ways to shorten a URL, from one click to automation: paste, name it, your domain, API; an expiry can be added to any of them, and a password to any made while signed in

Method 1: paste it — no account

For a link you'll share once and don't need to manage.

  1. Open the homepage.
  2. Paste the long address into the box.
  3. Press Enter or the arrow.

You get a link like xlyl.link/kZHTt5, copied and ready. It works immediately and redirects with a 302. What it doesn't have is a name you chose, and because it isn't attached to an account, you can't edit it later and its clicks aren't counted: there's no statistics page for it. If you'll want the numbers, sign in before you create the link.

Good for: a link in a chat, a one-off share, testing the service.

Method 2: name it — a custom alias

For anything a person will read, say or type.

  1. Sign in — accounts are free.
  2. Paste the long address, then tick Advanced options.
  3. In Short link, type the ending you want: spring-sale, menu, webinar.
  4. Shorten.

The link is now xlyl.link/spring-sale. Aliases are unique per domain, so if someone has taken /spring-sale on the shared domain you'll be told; that's the moment to consider your own domain, where every alias is free.

The naming guide covers what makes a good alias: lowercase, hyphens, plain words, under about 30 characters, nothing that will be wrong next year.

Good for: anything on a slide, in print, spoken on a podcast, or in a post people will screenshot.

Method 3: your own domain

For anything with your name on it — which, for a business, is everything.

  1. On the domains page, read the DNS record shown: an A record pointing at the server's IP address, which works for a whole domain or a subdomain such as go.yourbrand.com. (Where the page also offers a CNAME, that works for a subdomain too.)
  2. Add the record at your DNS provider.
  3. Add the domain on the page. Use Check domain to confirm it works; it requests the domain live and tells you what, if anything, is still missing.
  4. From now on, pick the domain in the Short link field's domain menu when you create a link.

The link becomes go.yourbrand.com/spring-sale, served over HTTPS once the domain's certificate is in place; the check shows Working once it is ready. The custom domain guide walks through the DNS step, with Cloudflare as the worked example, and the custom URL shortener page explains what a recognisable domain tells the person deciding whether to tap.

Good for: every link a customer, reader or follower will see.

Method 4: with a password or an expiry

Both are in the same advanced options panel and combine with everything above.

Password. Type one in the Password field. Visitors get a form instead of a redirect, and the destination isn't sent to their browser until the password is right. This is real protection, unlike an obscure alias, whose destination is one preview away. Password-protected links suit drafts, previews, recordings and anything you'd rather not have forwarded.

Expiry. Set a lifetime — 30m, 8h, 7d — in the Expires in field. After it passes, the link returns a not-found page and its alias is freed. Expiring links suit time-boxed offers, event registration, and download links that shouldn't circulate forever.

Description. Not a protection, but set it now: what the link is for, who made it, the campaign. The dashboard searches descriptions, so this is how you'll find the link in six months.

For a spreadsheet of placements, a CMS that should shorten every article, a script that makes a link per customer, or anything else where a person clicking a form is the bottleneck.

  1. On the API key page, generate a key. It's shown once; only a hash is stored.
  2. Send a request with the key in the X-API-Key header:
curl -X POST https://xlyl.link/api/v2/links \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target":"https://example.com/spring","customurl":"spring-sale","description":"Spring 2026 · newsletter"}'

The whole address is stored as the destination, query string and all — the ? and & separators are part of the URI syntax defined in RFC 3986, and the redirect reproduces them exactly.

The response contains the short link. Every option the form has — alias, domain, password, expiry, description — is a field in the request, and the same key lists, edits and deletes links and reads their statistics. The API reference documents the endpoints for links, statistics, click exports, domains and users; the key page shows samples in curl and JavaScript that already contain your key.

Good for: bulk, automation, integration. There's no bulk upload form because a ten-line script handles any spreadsheet and any rule you want to apply to it. The API has the same creation limits as the form (a set number of links per account in any 24 hours, plus a short-term rate limit), so pace a large list.

Which method, when

You want to… Method
Share a link once in a chat Paste (1)
Put a link on a slide, in print, or say it aloud Alias (2)
Put your brand on it Your domain (3)
Keep a preview or draft from being forwarded Password (4)
Have a link stop working after an event Expiry (4)
Make dozens of links from a list API (5)
Track a campaign across channels Alias per placement (2 or 3) + UTM tags
Print a QR code Alias on your domain (3) + QR code

The methods stack. An API-made link can be on your domain, named, password-protected, expiring and described, all in one request.

After you've shortened it

Copy it from the dashboard, not by retyping. Every link has a copy button; retyping is how l becomes 1.

Get the QR code if it's going on anything physical. The QR icon on the link shows a code that encodes the short link, ready to download as SVG or PNG, so the printed code stays valid however often you change the destination. The QR guide covers size and placement.

Watch the statistics page. For links made while signed in: clicks by hour and day, referrers, countries, devices — with known bots filtered out by user agent and no visitor IPs stored. For a campaign, make a separate link per placement so each count means something.

Edit it when things change. Target, description, password and expiry can all be changed from the link's row (a password or expiry can be changed but not removed). The short link stays the same; only where it goes moves. This is the single most useful thing about a shortener and the reason to use one even for links that don't need to be short. Changing the alias is different: it changes the address itself, and the old short link stops working at once, with nothing redirecting from it, so don't rename a link that's already been shared.

Mistakes to avoid

  • Shortening a link with your own tracking parameters and then sharing the long one anyway. Share the short link only; the tags travel inside it.
  • Choosing an alias with a date or version in it for something you'll reuse. You'll either reprint or live with a lie.
  • Using a random code where a person will type it. x7Fq2 is a lost visitor waiting to happen.
  • Relying on an obscure alias for privacy. Anyone can preview a link. Use a password.
  • One link for every channel. You'll know the total and nothing else.
  • Deleting a link that was printed. Point it somewhere useful instead; a dead short link is a dead end with your name on it.

Frequently asked questions

Is it free to shorten a URL?
On Xlyl, yes — every feature, including custom aliases, your own domain, analytics, QR codes and the API, is free for every account. A plain short link doesn't even need an account.
Do I need an account to shorten a link?
No. Paste a link on the homepage and you get a short one back immediately. An account is what lets you name the link, put it on your domain, edit it later and see its clicks: links made without one aren't counted and have no statistics page.
Can I shorten a link that has a question mark and parameters in it?
Yes. The whole address, parameters included, is stored as the destination, and the short link redirects to it exactly. This is the usual way to hide UTM tags behind a clean link.
How do I shorten many URLs at once?
Use the API: one request per link, from a script, a spreadsheet or your own system, each with its own alias, domain, description and options. There's no bulk upload form because a script is more flexible and fits any source of links. The same per-account creation limits apply as in the form.

Found this useful? Pass it on.

PostShare

Keep reading

All guides →