1
Paste your URL
2
Pick a slug
3
Share your link

How to Create Short Links: The Complete Guide for 2026

·8 min read

Short links turn long, unwieldy URLs into compact, shareable addresses. They're used everywhere — social media posts, email campaigns, printed materials, SMS messages, and API integrations. But how do they actually work, and what's the best way to create them in 2026? This guide covers everything from the basics of URL redirection to advanced methods using APIs and command-line tools.

What Short Links Are and How They Work

A short link is a condensed URL that redirects to a longer destination. When someone clicks xpo.link/demo, the shortener's server receives the request, looks up the slug demo in its database, and returns an HTTP redirect to the full URL.

There are two redirect types you should understand:

  • 301 (Permanent Redirect)— tells browsers and search engines that the short URL permanently points to the destination. Browsers may cache this, which means faster subsequent visits but less flexibility to change the destination.
  • 302 (Temporary Redirect)— tells browsers the redirect is temporary. The short URL is looked up fresh each time, so you can change the destination whenever you want. Most link shorteners use 302 or 307 redirects for this reason.

The redirect happens in milliseconds. The visitor lands on the destination page without noticing the intermediary step.

4 Methods to Create Short Links

Method 1: Free URL Shorteners

Tools like TinyURL and is.gd let you paste a URL and get a short link instantly. No account required. These work for one-off personal use, but they come with trade-offs: you can't track clicks, use a custom domain, or edit the destination after creation. The domain is always theirs, not yours.

Method 2: SaaS Link Management Platforms

Platforms like Xpolink, Bitly, and their alternatives offer dashboards where you can create, edit, and track short links. You get analytics (clicks, devices, countries, referrers), custom domains, team collaboration, and link management features. This is the best option for businesses and marketers who create links regularly.

Method 3: URL Shortener API

If you need to create links programmatically — inside a CI/CD pipeline, a marketing automation tool, or a custom app — an API is the way to go. Here's a quick example using curl with the Xpolink API:

curl -X POST https://xpolink.app/api/v1/links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/my-long-page",
    "shortCode": "spring-sale",
    "domain": "yourbrand.link"
  }'

The API returns the short URL, its metadata, and a QR code URL. Check the API documentation for the full reference.

Method 4: Command-Line Interface (CLI)

For developers who live in the terminal, the Xpolink CLI lets you create and manage links without leaving your workflow:

xpolink shorten https://example.com/my-long-page --slug spring-sale
# => https://yourbrand.link/spring-sale

The CLI supports bulk operations too — pipe a list of URLs from a file and create dozens of links in seconds.

Choosing the Right Short Code

The slug (the part after the domain) affects both readability and link length. Most platforms offer three options:

  • Shortest— the platform assigns the shortest available code (e.g., xpo.link/a3). Great when character count matters, like SMS or tweets.
  • Random— a randomly generated alphanumeric string (e.g., xpo.link/k7mP2x). Good for programmatic use where human readability isn't important.
  • Custom / Suggested— you pick a descriptive slug (e.g., xpo.link/spring-sale). Best for marketing links that people see and remember.

Custom Domains vs Shared Domains

Shared domains like bit.ly or xpo.linkare quick to start with, but they don't carry your brand. A custom domain like go.yourcompany.com builds trust, improves click-through rates, and looks professional in emails and print materials. Studies consistently show that branded links get 30-40% more clicks than generic short URLs.

Setting up a custom domain typically involves adding a CNAME or A record in your DNS settings. Most platforms, including Xpolink, verify the domain automatically and provision an SSL certificate so your links work over HTTPS.

Best Practices for Short Links

  • Use descriptive slugs — a slug like spring-sale tells the reader what to expect before they click.
  • Always use HTTPS— unencrypted short links can be intercepted or flagged by browsers. Make sure your shortener provisions SSL for custom domains.
  • Set a link title— adding a title helps you organise links in your dashboard and makes reports easier to scan.
  • Add expiry dates when appropriate— for time-limited promotions, set the link to expire after the campaign ends. This prevents stale links from confusing visitors months later.
  • Use UTM parameters on the destination — append ?utm_source=instagram&utm_medium=bio to the destination URL so your web analytics tool attributes traffic correctly.

Step-by-Step: Create a Short Link with Xpolink

Here's the quickest path from zero to a branded short link:

  • Sign up for a free account.
  • Optional: connect a custom domain in Settings → Domains.
  • Click New Link, paste your destination URL, and choose a slug (or let the platform suggest one).
  • Add a title and optional expiry date.
  • Click Create. Your short link is live instantly.
  • Share it anywhere — the analytics dashboard updates in real time as clicks come in.

The free plan includes 50 links per month with full click analytics. For higher volumes, API access, and team features, check the paid plans.

Ready to create branded short links?

Start free with 50 links per month. No credit card required.

Get Started Free
Back to blog