# xid

> Short, sortable, globally unique IDs for Go with no configuration

Source: https://talira.ai/catalog/xid-q7s154t9
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / unique ids](https://talira.ai/categories/libraries/unique-ids), [languages / go](https://talira.ai/categories/languages/go)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^1]
- Backed by: [Olivier Poitrey](https://talira.ai/orgs/olivier-poitrey.md)

xid is a Go library by Olivier Poitrey that generates globally unique IDs in server code with no configuration or central generator. It uses MongoDB's Object ID layout (seconds since the epoch, a machine identifier, the process id and a counter) in 12 bytes, written as a 20-character base32hex string that stays URL-safe and sorts by time. That makes it shorter than a UUID's 36 characters and, unlike Twitter's Snowflake, it needs no machine or data-centre setup, while its binary form stays compatible with MongoDB Object IDs.

## Links

- GitHub: https://github.com/rs/xid
- Docs: https://pkg.go.dev/github.com/rs/xid

## Problems it solves

- generate short unique IDs in my Go service without a central ID server
- IDs that sort by creation time and are shorter than UUIDs in URLs
- unique IDs across many servers without configuring each machine like Snowflake needs

## Features

- 12-byte IDs as 20-character base32hex strings
- sortable by creation time
- no configuration or central server
- binary form compatible with MongoDB Object IDs

## Trust

Overall: 0.47 out of 1.
Signals: maintenance 0.47, adoption 0.73, momentum 0.46, community 0.69, backing 0.30, extensibility 0.00.

- last commit 2 months ago
- 3 commits in the last 90 days
- latest release v1.2.1 8.3 years ago
- 4.3k GitHub stars
- 51 contributors
- backed by Olivier Poitrey

## Alternatives

- [gofrs/uuid](https://talira.ai/catalog/gofrs-uuid-j4s8sent.md): A pure Go package for creating and parsing UUIDs

## Sources

[^1]: https://github.com/rs/xid/blob/master/LICENSE (checked 29 Nov 2026)
