Skip to content
gohacks.dev
Architecture

Sqids Encoder

Encode numbers into short, URL-safe ids with Sqids and decode them back, with your own alphabet and a minimum length.

Free · No sign-up · Your inputs stay in your browser

Input

Encode and decode Sqids (short ids from numbers)

Output

Id

6 characters

Sqids (the successor to Hashids) turns numbers into short, URL-safe ids such as /orders/86Rf07 instead of /orders/123, and back. It is encoding, not encryption: anyone with the alphabet can decode it, so it hides sequence and volume, not data. The official libraries also skip ids containing words from a profanity blocklist, which this does not, so a rare id may differ from theirs.

Runs in this browser. Nothing you paste is sent to a server.

Why use it

Sequential ids in URLs reveal how many orders or users you have and invite enumeration of /invoices/1, /invoices/2. Encoding the id hides the sequence while keeping the database's integer key. The project documents the algorithm at sqids.org with libraries for most languages.

Not security

Sqids is an encoding, not encryption: anyone with the alphabet can decode an id, and the default alphabet is public. Authorisation checks are still required; a shuffled custom alphabet only makes your ids look different from other sites'.

Share

Frequently asked questions

Can I decode a Sqids id without the alphabet?
Only if the default alphabet was used, which is the case for most installations. With a custom alphabet you need that alphabet.
Do the official libraries produce the same ids?
Yes for almost all inputs. They also skip ids that contain words from a profanity blocklist by re-encoding, which this tool does not, so a rare id can differ.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools