ForHosting KIT · Web Scraping & Monitoring

Generate short URL slug

Give a long URL and a seed and get a short code that never changes: the example page with the seed tenant-acme-v1 always becomes rTEr1Ff, seven base62 characters by default. Nothing is fetched or stored, and no live link is created. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Web address
https://example.com/docs/guide
Seed
tenant-acme-v1
Length
7
You get
Slug
rTEr1Ff
Alphabet
base62
Short path
/rTEr1Ff

URL shorteners need short, opaque path codes that map back to a long target without leaking structure in the link itself. Teams that build their own shortener—or allocate vanity codes offline before write—need a deterministic function: the same target URL and tenant seed must always produce the same slug of a chosen length, so retries and multi-region writers never invent colliding random strings for the same logical link. This capability accepts a target URL, a seed (namespace, secret, or tenant key), and an optional length (default seven, minimum four), then expands a pure FNV-style mix of URL plus seed into base62 digits drawn from 0-9, A-Z, and a-z.

How the seeded base62 shortener slug is built

A shortener slug is not a human-readable title slug. It is an opaque token in a compact alphabet that fits QR codes, SMS, and printed packaging while still giving enough combinatorial space for millions of links. This tool uses the classic base62 alphabet of ten digits, twenty-six uppercase letters, and twenty-six lowercase letters—sixty-two symbols that travel safely in path segments without percent-encoding.

The generator concatenates the target URL, a NUL separator, and your seed, then runs counter-salted FNV-1a 32-bit rounds that expand into five base62 digits per round until the requested length is filled. Because the mix is pure arithmetic on character codes, the same inputs always yield the same slug across Node and the browser. The seed is what makes multi-tenant systems safe: two tenants shortening the same marketing URL with different seeds get different codes, so shared public namespaces do not reveal that two orgs pointed at the same destination.

Length defaults to seven characters (about 3.5e12 possibilities) and may range from four to thirty-two; four is the hard floor because three-character spaces are too small for open internet shorteners and invite brute-force enumeration of your path space.

Where a seeded short-URL slug generator earns its keep

Self-hosted shortener backends use this capability to precompute codes in workers before a transactional insert, keeping allocation logic identical in every region without sharing a central random sequence. Marketing ops teams generate stable campaign codes offline from a known landing URL and a campaign seed so creative review, QR artwork, and the production cutover all share one string. Multi-tenant SaaS products pass the tenant id as seed so customer A and customer B never receive the same public path for identical destinations, which simplifies abuse review and data residency stories.

Prefer longer lengths when your namespace is public and long-lived; use the minimum four only for closed systems with aggressive collision handling.

Self-hosted shortener allocation

Precompute a deterministic base62 path code from the long URL and a service seed before writing the redirect row in your own database.

Multi-tenant campaign codes

Mix a tenant or campaign seed with the same landing URL so each customer gets a distinct public slug without central randomness.

How do I generate a short URL slug from a URL and seed?

Send non-empty strings url and seed, optionally length (default 7, min 4, max 32).

Why is length below 4 rejected?

Codes shorter than four base62 characters are too small for public shortener namespaces and are easy to enumerate.

Does this create a live short link?

No. It only computes a deterministic slug string. You store the mapping and serve redirects on your own domain or shortener service.

What alphabet does the slug use?

Standard base62: digits 0-9, uppercase A-Z, and lowercase a-z. The response sets alphabet to base62 and length to the resolved character count.

Can two different URLs end up with the same slug?

Yes, especially at short lengths. The same inputs always give the same code, but different URLs can still land on one slug, so check for uniqueness when you save it and choose a longer length for public, long-lived links.

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.

POSThttps://api.kit.forhosting.com/web/url-shortener-slug-generate

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.

curl -X POST https://api.kit.forhosting.com/web/url-shortener-slug-generate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/docs/guide","seed":"tenant-acme-v1"}'
{
  "url": "https://example.com/docs/guide",
  "seed": "tenant-acme-v1"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "web.url_shortener_slug_generate",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

timeout_sec30
max_crawl_pages25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Nothing is fetched over the network and nothing is stored: you get the slug string and a ready short_path prefix, then you bind it in your own store. Lengths below four fail with invalid_input because codes that short are unsafe for public shortener namespaces at any meaningful scale.

How the seeded base62 shortener slug is built

The response echoes url, seed, and length, returns the slug, labels the alphabet as base62, and offers short_path as a slash-prefixed convenience for paste into templates—without claiming that path is live on any domain.

Input contract, response shape, and rejection rules

Empty url or seed, non-string objects for those fields, and missing required keys all fail clearly so form UIs can highlight the field. Pair the slug with your own uniqueness check on write: the function is deterministic for a triple of inputs, but two different URLs can still hash to the same short code at small lengths—your store must treat insert races as the source of truth. POST a JSON object with two required strings and one optional integer. Field url (aliases target, link, href, long_url) is the long destination you intend to bind later; it is not fetched, so localhost, deep paths, and query strings are all accepted as opaque text after trim, up to four thousand and ninety-six characters. Field seed (aliases key, salt, namespace, secret) is a non-empty string that namespaces the hash—use a per-tenant secret or a product line id so collisions across tenants stay improbable. Field length (aliases len, size, slug_length) defaults to seven when omitted; it must be an integer from four through thirty-two inclusive. Values below four raise invalid_input with a message that states the shortener slug minimum; values above thirty-two and non-integers are likewise rejected and are not billed. On success the body includes the normalized url and seed strings, the resolved length, the slug itself, alphabet set to base62, short_path equal to slash plus slug, and a short note reminding clients that this is a deterministic code, not a live redirect.

Where a seeded short-URL slug generator earns its keep

Remember that this endpoint does not create redirects, measure clicks, or reserve DNS—it only mint the opaque path segment your shortener will store.

Stable QR and print fixtures

Lock url, seed, and length in design tooling so packaging, SMS templates, and CI goldens always agree on the short path string.

What does the seeded short URL slug generator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →