<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/generate-short-url-safe-ids-from-numbers-with-sqids-ybaakjgne" -->

---
title: Generate Short, URL-Safe IDs From Numbers With Sqids
description: Sqids is a PHP library (successor to Hashids) that encodes one or more non-negative integers into short, URL-safe strings and decodes them back. It supports...
canonical: https://daily.dev/posts/generate-short-url-safe-ids-from-numbers-with-sqids-ybaakjgne
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Generate Short, URL-Safe IDs From Numbers With Sqids | daily.dev
og:description: Sqids is a PHP library (successor to Hashids) that encodes one or more non-negative integers into short, URL-safe strings and decodes them back. It supports...
og:url: https://daily.dev/posts/generate-short-url-safe-ids-from-numbers-with-sqids-ybaakjgne
og:image: https://api.daily.dev/og/posts/yBAakJGNe.png
og:image:alt: Generate Short, URL-Safe IDs From Numbers With Sqids
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Short, URL-Safe IDs From Numbers With Sqids

**[Laravel News](https://daily.dev/sources/ln)** · 3 min read · 7 upvotes · 0 comments

## Summary

Sqids is a PHP library (successor to Hashids) that encodes one or more non-negative integers into short, URL-safe strings and decodes them back. It supports cross-language compatibility across 40+ languages, configurable minimum length for uniform IDs, custom alphabets for per-app scrambling, and a built-in profanity blocklist. Common use cases include hiding sequential database keys in public URLs and packing multiple integers into a single token. Importantly, Sqids is an encoder, not an encryption tool — it should not be used for sensitive data or access control.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laravel-news.com/generate-short-url-safe-ids-from-numbers-with-sqids>

## Similar posts on daily.dev

- [UUIDs, ULIDs and Sqids: A Practical Deep Dive](https://daily.dev/posts/uuids-ulids-and-sqids-a-practical-deep-dive-79nwblyzu) · W endell Adriel · 16 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/generate-short-url-safe-ids-from-numbers-with-sqids-ybaakjgne)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Generate Short, URL-Safe IDs From Numbers With Sqids","url":"https://daily.dev/posts/generate-short-url-safe-ids-from-numbers-with-sqids-ybaakjgne","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/generate-short-url-safe-ids-from-numbers-with-sqids-ybaakjgne"},"datePublished":"2026-06-08T13:33:40.596Z","dateModified":"2026-06-08T13:34:10.251Z","description":"Sqids is a PHP library (successor to Hashids) that encodes one or more non-negative integers into short, URL-safe strings and decodes them back. It supports...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c59d397b88ff098b059f9115f806df1d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c59d397b88ff098b059f9115f806df1d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Laravel News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Laravel News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/ln","url":"https://daily.dev/sources/ln"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/generate-short-url-safe-ids-from-numbers-with-sqids-ybaakjgne","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Laravel News","item":"https://daily.dev/sources/ln"},{"@type":"ListItem","position":3,"name":"Generate Short, URL-Safe IDs From Numbers With Sqids"}]}
```

