Creating a Basic Short Link
You don’t need an account to create short links. Here’s how:Navigate to the home page
Visit the shrtnr home page at
/. You’ll see a prominent URL input field in the hero section.Paste your long URL
In the input field labeled “Paste your long URL here”, enter the full URL you want to shorten.The URL must be a valid format. Examples:
https://example.com/very/long/path/to/page?query=paramshttps://docs.example.com/documentation/getting-startedhttps://www.youtube.com/watch?v=dQw4w9WgXcQ
Click 'Shorten'
Click the Shorten button (or press Enter). The system will:
- Validate your URL
- Generate a random 8-character short code
- Store the URL mapping in the database
- Return the short URL
- Automatically copy it to your clipboard
Anonymous links (created without signing in) are stored in the database but cannot be managed or tracked in a dashboard. Sign in to access link management features.
Creating Links with an Account
When you’re signed in, you unlock powerful customization options:Custom Slugs
Instead of random short codes, you can choose memorable slugs for your links.Sign in to your account
Make sure you’re signed in. You’ll know you’re authenticated when you see additional fields below the main URL input.
Specify a custom slug
In the Custom slug (optional) field, enter your desired short code.For example, entering
my-link will create https://shrtnr.app/my-link.Slug validation rules
Custom slugs must follow these rules:Allowed characters
Allowed characters
Only letters (a-z, A-Z), numbers (0-9), hyphens (-), and underscores (_) are permitted.Examples:
- ✅
my-link - ✅
promo_2024 - ✅
Campaign123 - ❌
my link(spaces not allowed) - ❌
promo@sale(special characters not allowed)
Length requirements
Length requirements
Slugs must be between 1 and 20 characters long.
- ✅
a(minimum) - ✅
my-custom-short-link(18 characters) - ❌ “ (empty)
- ❌
this-is-a-very-long-slug-name(29 characters, too long)
Uniqueness
Uniqueness
Each slug must be unique across the entire platform. If someone else has already used
my-link, you’ll receive an error: Slug already in use.Try variations:my-link-2024my_link_v2mylink-alt
Setting Expiration Dates
Control how long your short links remain active by setting an expiration date.Access the expiry control
When signed in, you’ll see an Expires in (days, 1–30) field below the custom slug input.
Set the number of days
Enter a number between 1 and 30 to set how many days from now the link will expire.
- Default: 7 days
- Minimum: 1 day
- Maximum: 30 days
After a link expires, attempts to visit it will result in an error or redirect. Expired links can be viewed in your dashboard but cannot be accessed by visitors.
Combining Custom Slugs and Expiration
You can use both features together:https://shrtnr.app/holiday-sale that expires in 14 days.
Link Creation API
The link creation process sends a POST request to/api/shorten with the following payload:
Request format
Response format
On success:Error responses
| Status | Error | Cause |
|---|---|---|
| 400 | URL is required | Missing or empty URL |
| 400 | Invalid URL | URL format is invalid |
| 400 | Invalid slug | Custom slug violates validation rules |
| 400 | Slug already in use | Custom slug is taken |
| 401 | Sign in to use a custom slug | Attempted custom slug without auth |
| 500 | Something went wrong | Server or database error |
UI Behavior
Button states
The Shorten button has three states:-
Disabled (no URL entered)
- Appears grayed out
- Cursor shows “not-allowed”
- Button text: “Shorten”
-
Processing (request in flight)
- Button disabled
- Reduced opacity
- Button text: “Shortening…”
-
Ready (URL entered, not processing)
- Fully interactive
- Button text: “Shorten”
- Click to submit
Automatic clipboard copy
When a short link is successfully created:- The short URL is automatically copied to your clipboard via
navigator.clipboard.writeText() - A toast notification appears:
Short link copied: https://shrtnr.app/... - You can immediately paste the link wherever you need it
If clipboard access fails (due to browser permissions), the toast will still show your short URL so you can copy it manually.
Best Practices
Choose meaningful slugs
Choose meaningful slugs
For links you’ll share frequently, use descriptive custom slugs:
blog-post-seoinstead of random codeswebinar-2024for event linksgithub-repofor repositories
Set appropriate expiration dates
Set appropriate expiration dates
Match expiration to your use case:
- 1-3 days: Time-sensitive promotions, flash sales
- 7 days: Weekly newsletters, temporary campaigns
- 14-30 days: Monthly events, longer campaigns
Validate URLs before shortening
Validate URLs before shortening
Make sure your destination URL:
- Includes the protocol (
https://, not justexample.com) - Is correctly formatted with no typos
- Points to an active, accessible page
Next Steps
After creating your short links:- View all links: Visit your dashboard (see Dashboard guide) to see all links you’ve created
- Edit links: Change slugs or expiration dates in the dashboard
- Track performance: Monitor click counts for each link
- Manage links: Delete links you no longer need