Zero Signup ToolsFree browser tools

Developer Tools

Sqids and Hashids Encoder and Decoder

Encode integers to short Sqids or Hashids strings and decode them back in your browser. Set the alphabet, salt, and length. Spec-compatible. No signup.

Sqids and Hashids encoder and decoder

Sqids encodes one or more non-negative integers into a short, URL-safe string and decodes it back. It is the current library, formerly published as the rewrite of Hashids.

Options

Sqids settings

The set of characters the id is built from. Both sides must use the same alphabet to decode. Order matters: shuffling it changes every output.

Sqids is obfuscation, not encryption. It hides that an id is a sequential number, but the value can be decoded by anyone, so never use it to protect secret data.
Try a sample:

Output

Encoded id

6 characters

86Rf07

Verified: decoding this id with the same settings returns the original numbers.

What these ids are for

  • Turn a sequential database id like 1, 2, 3 into a short, non-guessable looking string for a URL or public API.
  • The transform is reversible, so you can decode the string back to the original id on your server without a lookup table.
  • Encode several numbers at once (for example a record id and a type id) into a single token.
  • They are not random ids. For random identifiers, a UUID, ULID, or NanoID is the right tool.

Sqids vs Hashids

  • Sqids is the current library. It has no salt; the alphabet is the only knob, and it ships a profanity block list that re-rolls the output if a banned word appears.
  • Hashids is the older, widely deployed library. It adds a salt and a minimum length, and reserves separator and guard characters internally.
  • Ids from one are not compatible with the other. Pick the algorithm your codebase already uses.
  • Neither is encryption. Treat the numbers as public once encoded.

How to use

  1. Pick the algorithm your project uses: Sqids (the current library) or Hashids (the classic, salt-based library).
  2. Choose Encode to turn numbers into a string, or Decode to turn a string back into numbers.
  3. For Sqids, optionally change the alphabet. For Hashids, set a salt and a minimum length to match your application configuration.
  4. To encode, type one or more non-negative integers separated by spaces or commas, then read and copy the generated id.
  5. To decode, paste an id and use the same alphabet (and salt for Hashids) that produced it. If the settings do not match, the tool will say so instead of returning wrong numbers.

About this tool

Sqids and Hashids Encoder and Decoder turns one or more non-negative integers into a short, reversible, URL-safe string and decodes such a string back to the original numbers, entirely in your browser. Both libraries solve the same problem: you have a sequential database id like 1, 2, or 12345, and you do not want to expose the raw counter in a URL or public API where it reveals how many records exist or invites people to enumerate them. Instead of a lookup table, these algorithms apply a deterministic, reversible transform, so the server can decode the string back to the id without storing anything. This tool implements both. Sqids is the current library (formerly published as the rewrite of Hashids): it has no salt, the alphabet is the only knob, and it ships a profanity block list that re-encodes the output with a new offset if a banned word appears in the result. Hashids is the older, very widely deployed library that has shipped in dozens of languages for over a decade: it adds a salt so the same numbers map to different strings in different projects, a minimum length that pads short ids, and reserved separator and guard characters drawn from a fixed set. The encoder accepts several numbers at once (separated by spaces or commas), validates that each is a non-negative safe integer, and shows the encoded id with a one-click copy and a verification line confirming that decoding the result returns the original numbers. The decoder takes a string and the same settings and prints the numbers it contains; if the alphabet or salt does not match, it tells you rather than returning wrong data, because both implementations validate a decode by re-encoding and comparing. The Sqids math uses BigInt internally so the full safe-integer range round-trips exactly, and the Hashids output is byte-for-byte compatible with the canonical library, so ids you generate here decode in your application and vice versa. One important caveat is stated plainly in the tool: Sqids and Hashids are obfuscation, not encryption. The mapping is reversible by anyone who knows the algorithm, so a salt only hides the sequence, it does not protect secret data. For random identifiers rather than encoded counters, a UUID, ULID, or NanoID is the right choice. Everything runs locally, so the numbers and ids you type are never uploaded.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools